The following program takes two inputs (comma separated) from the user:
puts "Enter the code"
input_codes = gets.split(',')
puts "your given code is: "
code_1 = input_codes[0]
code_2 = input_codes[1]
puts code_1=='GEO'
puts code_2=='TYP'
Output is the following:
Enter the code
> GEO,TYP
true
false
It should print true for both of the cases, right? Why is it printing false for the last case? What am I missing?
EDIT: Yeah, there was an extra newline character that I was missing in the beginning. Fixed the issue with the help of tadman. ANd yeah, the inspect thing was pretty cool and useful since then!