.split()
Splits the text into parts.
Syntax
s.split(",")Description
Splits the text by the given separator and returns an array. size() gets the number of parts, and [0] gets the first part.
Example
Loading editor…
Expected output
3 a
When to use?
CSV parsing, splitting a sentence into words.