.split() / .replaceAll()
Splitting and replacing.
Syntax
text.split(separator) // text.replaceAll(old, new)
Description
split divides the text at the given separator and returns a List. replaceAll replaces all matches with a new one (returns new text).
Example
Loading editor…
Expected output
[a, b, c] 2024/01
When to use?
CSV parsing, text cleaning.