JCW2
asked on
Matching Values
In Ruby, I'm having a problem comparing strings that were input from the keyboard.
example:
input = gets.to_s
test = "test"
puts "#{input.eql?(test)}"
User enters "test," minus quote marks.
The output should be:
false
I want to get a "true" because the entered value is the same as the stored value. How do I do this?
example:
input = gets.to_s
test = "test"
puts "#{input.eql?(test)}"
User enters "test," minus quote marks.
The output should be:
false
I want to get a "true" because the entered value is the same as the stored value. How do I do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER