On Mon, Dec 3, 2012 at 12:35 PM, Masoud Ahmadi <lists / ruby-forum.com> wrote:
> This row solved my problem,
>  if op == "Q\n"
> I was not aware of this little new line thing

Just a note on that one: I think this solution is inferior to doing

op.chomp!
if op == "Q"

or

if op.chomp == "Q"

Reason: on other platforms you might get a different terminating
character than \n.  Also the terminator is usually not considered part
of the input.  You could even go a step further and get rid of
whitespace thus allowing for more valid inputs:

op = gets.strip

Kind regards

robert

--
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/