String Split
The string::split
function divides a string into a list of substrings using a specified delimiter.
Syntax
string::split(<delimiter>, <string>)
Parameters
delimiter
: The string used to divide the input string into substrings.string
: The input string to be split.
Returns
- List: A list of substrings.
Example
string::split(",", "apple,banana,cherry")
This function is useful for breaking down a string into individual elements for processing or iteration.