From: Pen Ttt Date: 2010-07-24T12:02:09+09:00 Subject: Re: how to convert the string? irb(main):001:0> "-34\n \302\240".match(/\S+/).to_s => "-34" irb(main):002:0> "-\n \302\240".match(/\S+/).to_s => "-" irb(main):003:0> "-?\n \302\240".match(/\S+/).to_s => "-?" irb(main):004:0> "-jkl?\n \302\240".match(/\S+/).to_s => "-jkl?" irb(main):005:0> match(/\S+/).to_s is what i want. -- Posted via http://www.ruby-forum.com/.