Re: split(",,,x,,,", ",") returns ["x", "", ""].

2015-08-30 Thread Yukihiro Nakadaira
On Mon, Aug 31, 2015 at 12:19 AM, LCD 47 wrote: > On 30 August 2015, Yukihiro Nakadaira > wrote: ... > > Anyway, is it possible to change split()'s behavior to omit all empty > > field (split(",,,x,,,y,,,") => ["x", "y"])? > > You can achieve that by allowing multiple separators: > >

Re: split(",,,x,,,", ",") returns ["x", "", ""].

2015-08-30 Thread Bram Moolenaar
Yukihiro Nakadaira wrote: > split(",,,x,,,", ",") returns ["x", "", ""]. I think expected result is > ["x"]. The documentation says that only empty items at the start and end are dropped, thus the result should be ["", "", "x", "", ""]. But I can see you would like to drop all empty items. Or

Re: split(",,,x,,,", ",") returns ["x", "", ""].

2015-08-31 Thread Yukihiro Nakadaira
On Mon, Aug 31, 2015 at 1:35 AM, Bram Moolenaar wrote: > > Yukihiro Nakadaira wrote: > > > split(",,,x,,,", ",") returns ["x", "", ""]. I think expected result is > > ["x"]. > > The documentation says that only empty items at the start and end are > dropped, thus the result should be ["", "", "x

Re: Re: split(",,,x,,,", ",") returns ["x", "", ""].

2015-08-30 Thread Mikołaj Machowski
Dnia Niedziela, 30 Sierpnia 2015 18:35 Bram Moolenaar napisał(a) > So far the keepempty argument was zero or non-zero. If we make it a > string then we can pass different flags: > 0 default - drop empty items at start and end > 1 keep all empty items > 'd' drop all empty

Re: Re: split(",,,x,,,", ",") returns ["x", "", ""].

2015-08-31 Thread Christ van Willegen
On Mon, Aug 31, 2015 at 8:48 AM, Mikołaj Machowski wrote: > Dnia Niedziela, 30 Sierpnia 2015 18:35 Bram Moolenaar > napisał(a) >> So far the keepempty argument was zero or non-zero. If we make it a >> string then we can pass different flags: >> 0 default - drop empty items at start and