From: hemant Date: 2006-12-20T01:16:56+09:00 Subject: Re: Problem with string comparison On 12/19/06, Lucas Holland wrote: > Hi! > > The following code: > > name = gets.comp.to_s > if name == "Bill" or name == "Steve" > puts "Wow, you're pretty smart!" > end > > yields this error, once executed: > > NoMethodError: undefined method 'comp' for "Bill":String > > What is wrong with the code? > > Thanks in advance, Because comp method is not defined for String class, probably what you want is chomp and you don't need a to_s in the end. -- gnufied ----------- There was only one Road; that it was like a great river: its springs were at every doorstep, and every path was its tributary.