GLBasic User Manual

Main sections

SPLITSTR()

countl% = SPLITSTR(text$, array$$[], split$, bDropEmpty%)



Splits the string text$ into separate blocks. Every character in the string split$ will be considered a delimiter. The return value is the number of blocks created.

The optional parameter bDropEmpty% decides whether empty parts within 2 splitter characters are ignored (TRUE) or output as separate, empty elements (FALSE).



num = SPLITSTR(" Dream.Design - Entertainment", splits$[], ". -")
PRINT num, 0, 0
FOR i=0 TO num-1
PRINT ">"+splits$[i]+"<", 0, 20*(i+1)
NEXT
SHOWSCREEN
MOUSEWAIT



Output:
3
>Dream<
>Design<
>Entertainment<

See also...