From: viswesh Date: 2006-05-18T01:46:18+09:00 Subject: Re: is there "equalsIgnoreCase" in ruby? Hi Johnson, can u please correct the code... puts " what is your name" name = gets.chomp puts " hello "+ name+" how are you" fine = gets.chomp if fine == "good".casecmp("goo") #fine == "fine" or #fine == "ok" or #fine == "wonderfull" puts " great" else puts "oh iam sorry" end thanx Lyle Johnson wrote: > On 5/17/06, viswesh wrote: > >> Please let me know whether any method similar to ("equalsIgnoreCase" in >> java) >> exists in ruby as well... > > Yes, it's called String#casecmp(). -- Posted via http://www.ruby-forum.com/.