From: Benoit Daloze Date: 2010-03-04T23:29:38+09:00 Subject: Re: splitting --0016364d23278a0bb10480fa6d5b Content-Type: text/plain; charset=ISO-8859-1 $ ri String#split str.split(pattern=$;, [limit]) If the limit parameter is omitted, trailing null fields are suppressed. If limit is a positive number, at most that number of fields will be returned (if limit is 1, the entire string is returned as the only entry in an array). If negative, there is no limit to the number of fields returned, and trailing null fields are not suppressed. On 4 March 2010 14:35, Luis Lavena wrote: > On Mar 4, 1:00 pm, DMG wrote: > > Hi, > > > > I suppose that: > > ".".split(".") > > will give me array with two empty strings instead of empty array. > > > > How can I do that? > > There is nothing before or after the period. > > irb(main):001:0> " . ".split('.') > => [" ", " "] > irb(main):002:0> ".".split('.') > => [] > > -- > Luis Lavena > > --0016364d23278a0bb10480fa6d5b--