Improved lume.split()'s README.md section for clarity

This commit is contained in:
rxi 2014-03-19 19:26:55 +00:00
parent ad34f6ce33
commit d69f419f5a

View File

@ -227,9 +227,9 @@ lume.deserialize("{1, 2, 3}") -- Returns {1, 2, 3}
``` ```
### lume.split(str [, sep]) ### lume.split(str [, sep])
Returns an array of the words in the string `str`. If `sep` is provided then Returns an array of the words in the string `str`. If `sep` is provided it is
consecutive delimiters are not grouped together and are deemed to delimit empty used as the delimiter, consecutive delimiters are not grouped together and will
strings. delimit empty strings.
```lua ```lua
lume.split("One two three") -- Returns {"One", "two", "three"} lume.split("One two three") -- Returns {"One", "two", "three"}
lume.split("a,b,,c", ",") -- Returns {"a", "b", "", "c"} lume.split("a,b,,c", ",") -- Returns {"a", "b", "", "c"}