Code is wrong or is there an error?


Not quite sure what I’m doing wrong but every time I hit run it says I’m incorrect. I’m comparing the code and it seems fine. This is what I’ve put. Thank You.

print "Pleathe enter a thtring: " 
user_input = gets.chomp

if user_input.include? "s"
  user_input.gsub!(/s/, "th")
  puts "Nothing to do here!"


Just for the fun of it, try adding a puts statement just before the if statement…

puts user_input

Now when you run the code, enter a lowercase only string. What gets printed?


Thanks. It seemed to have worked. However, I’m unable to enter a string when I run the code. So all I’m getting this and I’m unable to enter anything.
23 PM


I think I got it. It’s just taking a long time to run. Thank You.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.