HyperMath

Splitting Strings Separated by Delimiters

Splitting Strings Separated by Delimiters

Previous topic Next topic No expanding text in this topic  

Splitting Strings Separated by Delimiters

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

t = StrSplit(s, [del])

or

t = string.split(s, [del])

Splits a string separated by a delimiter and returns each part in a table.

Option

Description

s

The subject string.

del

The delimiter represented as a character. Default delimiters is assumed to be whitespace if omitted.

t

A table of strings containing the individual parts of the subject string.

     > s = ‘abc, klm, xyz’;

     > t = StrSplit(s, ","); print(t[1],t[2],t[3])

     abc   klm   xyz