- Index
- »
- axon
- »
- func:split
def
func:split
split(val, sep: null, opts: null)
Split a string by the given separator and trim whitespace. If sep
is null then split by any whitespace char; otherwise it must be exactly one char long. See Str.split
for detailed behavior.
Options:
- noTrim: disable auto-trim of whitespace from start and end of tokens
Examples:
"a b c".split >> ["a", "b", "c"] "a,b,c".split(",") >> ["a", "b", "c"] "a, b, c".split(",") >> ["a", "b", "c"] "a, b, c".split(",", {noTrim}) >> ["a", " b", " c"]