Puts Statement with String Interpolation


#1

I am attempting to figure out lesson 7 within the Control Ruby Unit. It states the following:
"Add a puts statement that uses string interpolation to show the user their transformed string."
I typed in the following code:

print "String Please" 
user_input = gets.chomp
user_input.downcase!
If user_input.include? "s" 
user_input.gsub!(/s/,"th")  
puts "Your string is #{user_input}" 
else 
    print " your string is #{user_input}!" 
end 

Replace this line with your code.


#2

It's just asking you to use the puts command when your string goes through the transformation.
if user_input.include? "s"
puts user_input.gsub....


#3

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