Regex Split() Method

Splits the string into parts using the regular expression as a delineator.

Function Signature

 Vector Split( string value, bool trim )

Parameters

Parameter Type Description

value

string

The string to be searched.

trim

bool

If true, the resulting strings in the Vector will have the whitespace trimmed.

Return

Type Description

Vector

A Vector containing substrings as its elements.

Technical Details

SBM ModScript version: 11.6.1.

Example

var r = Regex();
r.Compile( "\\d+" );
var v = r.Split( "12ab3d456e78", true );
for ( s : v ) {
  Ext.WriteStream( s );
}

Result:

ab
d
e

Notes

None.

Related Topics

Regex