Split string or character vector at specified delimiter
splits C
= strsplit(str
,delimiter
)str
at
the delimiters specified by delimiter
.
If str
has consecutive delimiters, with no other characters
between them, then strsplit
treats them as one delimiter.
For example, both strsplit('Hello,world',',')
and
strsplit('Hello,,,world',',')
return the same
output.
specifies additional delimiter options using one or more name-value pair
arguments. For example, to treat consecutive delimiters as separate delimiters,
you can specify C
= strsplit(str
,delimiter
,Name,Value
)'CollapseDelimiters',false
.
Starting in R2016b, the split
function
is recommended to split elements of a string array.