From: david@... Date: 2006-05-18T05:10:31+09:00 Subject: Re: Please answer to this code? I assume you are getting an error that looks something like: list.rb:8: private method `String' called for "David\n":String (NoMethodError) That is telling you that there is no method named String for the string object that you named "fine". On the line where you do the comparison with "good" I assume you want to compare two strings. The variable fine is already a string so you don't have to do any sort of implicit converstion first. if fine == "good" That's all you need there. Now if you were comparing a variable that contained something other than a string, you could force a conversion (vaguely similar to a cast in other languages) by calling the to_s method. That would look like this: if fine.to_s == "good" however that is totally unnecessary here because both items are already strings. David Koontz > viswesh wrote: > can anybody execute it and tell me where i go wrong.please let me > know asap... > > > puts " what is your name" > name = gets.chomp > > puts " hello " + name + " how are you" > > fine = gets > > if fine.String=="good" > puts " good buddy" > else > puts "oh iam sorry" > end