From: Mike Nelson Date: 2006-05-18T03:30:15+09:00 Subject: Re: Please answer to this code? viswesh wrote: > can u suggest me how to write a method where both cases are accepted to > a given string and that method i want to refer in the below program... I'm not too sure what you are asking for. Something like this? puts " what is your name" name = gets.chomp def checkIfGood(string) if string == "good" " good buddy" else "oh iam sorry" end end puts " hello #{name} how are you" puts checkIfGood(gets.chomp) -- Posted via http://www.ruby-forum.com/.