From: SZMURLO MAURICE Date: 2000-12-22T00:24:27+09:00 Subject: [ruby-talk:7878] RE: beginner's problem This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C06B61.88B9C690 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit ruby -e 'p gets' aaa "aaa\n" gets returns the end of line character as well try strip or chop maurice # Hi, # # Where am I going wrong? # # st='x' # #st=gets # if st=='x' # puts 'it's x' # else # puts 'not x' # end # # as written it prints "it's x" as expected but if I take away the # and # execute the st=gets line it's never x. # # Thanks, # John # # # ------_=_NextPart_001_01C06B61.88B9C690 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 7bit RE: [ruby-talk:7877] beginner's problem

 ruby -e 'p gets'
aaa
"aaa\n"

gets returns the end of line character as well

try strip or chop

maurice

# Hi,
#
# Where am I going wrong?
#
# st='x'
# #st=gets
# if st=='x'
#   puts 'it's x'
# else
#   puts 'not x'
# end
#
# as written it prints "it's x" as expected but if I take away the # and
# execute the st=gets line it's never x.
#
# Thanks,
# John
#  
#
#

------_=_NextPart_001_01C06B61.88B9C690--