Previous Topic

Next Topic

Split - MaxBasic Function

Split(Text: String, Delimiter: String): StringList

Splits a text string into a list of strings, separated by a delimiter. Given a Text string and Delimiter string, returns a StringList Object of tokenised strings.

Split function syntax has these named arguments:

Parameter

Description

Text

Required. String to be split.

Delimiter

Required. The character at which to split Text.

Sample code:

  strText = "I2 B1 B3 C5 F1 C8"
  Dim AccredoTokens as Object
  AccredoTokens = Split(strText, " ")
  Print "Source:" & strText
  If AccredoTokens.Count > 0 Then
    For x = 0 to AccredoTokens.Count - 1
      Print AccredoTokens[x]
    Next x
  Else
    Print "Not split"
  End If

Returns:

Source:I2 B1 B3 C5 F1 C8

I2

B1

B3

C5

F1

C8

See Also

String Functions

Book Contents

Book Index