From: "Peña, Botp" Date: 2008-06-28T12:59:50+09:00 Subject: Re: File question From: Xuan [mailto:xuanpa@gmail.com] # Instead of c.chomp! as it was suggested, use c=c.chomp(" ") before the that is dangerous since chomp(" ") only chomps the ending space, but not line endings like newline. c="asdf \n".chomp(" ") #=> "asdf \n" in his case, i would prefer #strip wc will strip out all whitespace before and after the string like, c=" asdf \t \r\n" #=> " asdf \t \r\n" c.strip! #=> "asdf" # "if"statement. The problem seems to be a white space at the end of # "c".. if you use print instead of puts you'll see it. using p is better/catching to the eye print "asdf " asdf #=> nil p "asdf " "asdf " #=> nil # About your second problem I just tested it and works fine for me. # Maybe txt file encoding is wrong...be sure to save it with utf-8 enc. i agree. kind regards -botp