I dont understand why user_input2 is changed after changing user_input?


#1



print "give an input"
user_input = gets.chomp
user_input2 = user_input
user_input.downcase!

puts"your string is :#{user_input2}"

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

else
puts"NOthing"
end

puts"your string is :#{user_input2}"


#2

Not for me.
Just do
print "give an input"
user_input = gets.chomp
user_input2 = user_input
user_input.downcase!
Then when the thing in the top right comes up just type a random word twice.


#3

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