From: Wesley J Landaker Date: 2003-06-26T22:43:54+09:00 Subject: Re: String#split(' ') and whitespace (perl user's surprise) On Thursday 26 June 2003 6:14 am, Mike Stok wrote: > In irb: > >> ' A 50 3 for 130'.split(' ', 3) > > => ["A", "50", " 3 for 130"] > > What I'd like Ruby to do > > >> ' A 50 3 for 130'.split(' ', 3) > > => ["A", "50", "3 for 130"] I should have mentioned that as a workaround, you can do this: ' A 50 3 for 130'.split(' ', 3).map { |x| x.strip } I agree you shouldn't have to do that, but it will get you going with minimal changes. -- Wesley J. Landaker - wjl@icecavern.net OpenPGP FP: C99E DF40 54F6 B625 FD48 B509 A3DE 8D79 541F F830