From: "David A. Black" Date: 2008-05-02T11:48:38+09:00 Subject: Re: strip method Hi -- On Fri, 2 May 2008, Amasa Masiarek wrote: > s = < a1\t b1 > a2\tb2 > EOS > > s.each{|e| > a = e.strip.split("\t") > p a[1] > } > > output: > " b1" > "b2" > > expected output: > "b1" > "b2" > > What is wrong? Your expectation :-) Sorry, I couldn't resist. strip removes space on the right and left. If you start with "a1\t b1\n", the stripped version is "a1\t b1". If you split that on \t, you get "a1" and " b1". At no point have you removed the middle space. David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates!