split
Splits a string into substrings.
Description
The split
function splits the input string x
into a list of substrings
using the specified pattern
. Optional arguments allow limiting the number
of splits (max
) and reversing the splitting direction (reverse
).
x: string
The string to split.
pattern: string
The delimiter or pattern used for splitting.
max: int (optional)
The maximum number of splits to perform.
Defaults to 0
, meaning no limit.
reverse: bool (optional)
If true
, splits from the end of the string.
Defaults to false
.