Link to home
Start Free TrialLog in
Avatar of JCW2
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?
ASKER CERTIFIED SOLUTION
Avatar of JCW2
JCW2

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JCW2
JCW2

ASKER

As far as I know this is the proper solution.