# Split

Array = Split ( String [ , Separators , Escape ] )

Splits a string into substrings delimited by Separators . Escape characters can be specified: any separator characters enclosed between two escape characters are ignored in the splitting process.

Note that Split takes only three arguments: if you want to use several separators, you should pass them as the second parameter, concatenated in a single string.

By default, the comma character is the separator, and there are no escape characters.

This function returns a string array filled with each detected substring.

Example

    DIM Elt AS String[]
    DIM Sb AS String

    Elt = Split("Gambas Almost Means BASIC ! 'agree ?'", " ", "'")

    FOR EACH Sb IN Elt
      PRINT Sb
    NEXT

    Gambas
    Almost
    Means
    BASIC
    !
    agree ?

See also

LTrim$ | Left$ | Lower$ / LCase$ | Mid$ | RTrim$ | Replace$ | Right$ | Space$ | Split | String$ | Subst$ | Trim$ | Upper$ / UCase$