SUBSTR$
|
Syntax: |
SUBSTR$(<String>,<Separator>,<Number
of Substring>)
|
||||||
|
|
|
||||||
|
Meaning: |
Returns a substring from a string which has
separators. <Separator> divides the <String>
into several substrings. SUBSTR$ returns the substring number <Number of
Substring>. If <Number of Substring> <= 0, the
first substring is returned. |
||||||
|
Parameter: |
|
||||||
|
Sample: |
H$ =
"AAA;BBB;ccc" SEP$ =
";" S0$ = SUBSTR$(H$,SEP$,0) /* S0$ contains "AAA" S1$ = SUBSTR$(H$,SEP$,1) /* S1$ contains
"AAA" S2$ = SUBSTR$(H$,SEP$,2) /* S2$ contains
"BBB" S3$ = SUBSTR$(H$,SEP$,3) /* S3$ contains
"CCC" S4$ = SUBSTR$(H$,SEP$,4) /* S4$ contains "" H$ =
"Hello" S1$ = SUBSTR$(H$,";",1) /* S1$ contains "Hello" S2$ = SUBSTR$(H$,";",2) /* S2$ contains "" H$ =
"Test1;;Test2;" S1$ = SUBSTR$(H$,";;",1) /* S1$ contains
"Test1" S2$ = SUBSTR$(H$,";;",2) /* S2$ contains
"Test2;" |
||||||
|
See also: |
|