Hi mike, 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... thanx viswesh wrote: > Hi Mike and Daniel, > > That's wonderfull quick time replies and iam thankfull for both. > Yeah Mr.Mike ur right. > thanks again.. > bye > > > Mike Nelson wrote: >> 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 >> >> I think you forgot the .chomp on the second gets. This is probably your >> main issue. Some style suggestions, >> >> >> puts " what is your name" >> name = gets.chomp >> >> puts " hello #{name} how are you" >> fine = gets.chomp >> >> if fine == "good" >> puts " good buddy" >> else >> puts "oh iam sorry" >> end -- Posted via http://www.ruby-forum.com/.