split

Syntax

split(str, [delimiter])

Arguments

str is a STRING scalar.

delimiter is a CHAR or STRING scalar indicating the separator. It can consist of one or more characters, with the default being a comma (‘,’).

Details

If delimiter is not specified, split str into a CHAR vector.

If delimiter is specified, use delimiter as the delimiter to split str into a CHAR vector or a STRING vector.

Examples

$ split("xyz 1");
['x','y','z',' ','1']

$ split("xyz 1"," ");
["xyz","1"]

$ split(`xyz1,`xyz);
[,"1"]

$ split(`xyz1,`xyz)[1];
1

$ split("xyz 1 ABCD 3241.32"," ");
["xyz","1","ABCD","3241.32"]

$ split("XOM|2018.02.15|76.21", "|");
["XOM","2018.02.15","76.21"]