lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Another interesting thought is if it should return all indexes it can find:

local blah, this_is_nil, bleh = string.split("this  that", "%s")
local blah, bleh = string.split("this  that", "%s")

You could also allow for a third parameter (true/false/nil) to decide
if it should respect split strings of 0 length. (true enabling that as
most split() functions (imo) avoid it)

On Sun, Jan 17, 2010 at 9:41 PM, Vaughan McAlley <> wrote:
> 2010/1/18 Majic <>:
> Global, I think (not to be confused with global variables :-) )
> Could string.split() be like string.gmatch(), but just return what
> isn’t matched (ie what lies between the matches)?
> Vaughan