Split

From MiniScript Wiki
Revision as of 16:18, 17 March 2020 by 71.226.33.30 (talk) (Created page with "<c>split</c> splits a string into a list, by some delimiter. See also: join === Arguments === {| class="wikitable" |- ! Parameter Name !! Default Value !! Meaning |- |...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

split splits a string into a list, by some delimiter.

See also: join

Arguments

Parameter Name Default Value Meaning
self string string to split
delimiter string, default "" substring to split on
maxCount number, default -1 if > 0, split into no more than this many strings

Usage Notes

split may be called with function syntax or dot syntax.

Example

"foo bar baz".split		// returns ["foo", "bar", "baz"]         "foo bar baz".split("a", 2)	// returns ["foo b", "r baz"]