Split()

Top  Previous  Next

Split() - Split a String into an Array

Description

The Split() function converts a delimitered string into an array of substrings.

Array = Split(String, Delimiter[, count[, method]])

Returns an array of strings, each of which is a substring of String formed by splitting it on boundaries formed by the Delimiter.

The optional parameter Count specifies the number of substrings to split. Method optionally specificies the comparison mode which is either 1 for text or 0 for binary.

Example

pizza = "piece1;piece2;piece3;piece4;piece5"

pieces = Split(pizza, ";")

 

SMEvent.Raise "Trace", "You have " & UBound(pieces) + 1 & " pieces of pizza"