"c" wont get replaced using additional .gsub, only "s"


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-JdNDe/0/8?curriculum_id=5059f8619189a5000201fbcb


"c" wont get replaced using additional .gsub, only "s"


print "What would wou like to Daff-ify?"
user_input = gets.chomp
user_input.downcase!

if user_input.include? "s" || "c"
user_input.gsub!(/s/, "th")
user_input.gsub!(/c/, "the")
puts "Your string daffif-ied is: #{user_input}" 
else puts "Try using a word with an 's'"
end


#2

That's not entirely true.

Here's an example of running your code:

What would wou like to Daff-ify?chase
Your string daffif-ied is: thehathe

#3

print "What would wou like to Daff-ify?"
user_input = gets.chomp
user_input.downcase!

if user_input.include? "s" or user_input.include?"c"
user_input.gsub!(/s/, "th")
user_input.gsub!(/c/, "the")

else puts "Try using a word with an 's' or 'c'"
end

puts "Your string daffif-ied is: #{user_input}"

My input was: Sheila sells sea shells on the sea shore. Conrad catches cat-fishes as a chewy chore.
My output: thhila thell thea thhellth on the thea thhore. theonrat theaththeeth theatfithheth ath a thehewy thehore.

But not sure if this is a better way to write for what you want to achieve.


#4