From: Kyle Schmitt Date: 2007-03-31T04:16:14+09:00 Subject: Re: Newbie needs a pointer your string to quit has garbage (like a \n or somefin) at the end. A little function like this may help def same(somestring) input=gets if somestring==input puts "Same" else puts "#{input}!=#{somestring}" end end That will show what you're already seeing. So add a .length.. def same(somestring) input=gets if somestring==input puts "Same" else puts "#{input}!=#{somestring}" puts "input.length=#{input.length}" puts "somestring.length=#{somestring.length}" end end Humm.... so what do we do? strip. you _could_ do input=input.strip But that's not fun. Use a bang at the end of common functions to use the dangerous destructive fun version :) usually a ! changes the object itself so input.strip! def same(somestring) input=gets input.strip! if somestring==input puts "Same" else puts "#{input}!=#{somestring}" puts "input.length=#{input.length}" puts "somestring.length=#{somestring.length}" end end Does that help?