StrFormat,SPLIT
Syntax
StrFormat,SPLIT,<%string%>,<DelimiterChar>,<Index>,<%VarResult%>
This command is used with the Loop command to split up a given string and act on the individual components.
(Index=0 --> number of items)
Example:
Set,%source%,"The quick brown fox jumps over the lazy dog" StrFormat,SPLIT,%source%,#$s,0,%count% Loop,%ScriptFile%,Section,1,%count% [Section] StrFormat,SPLIT,%source%,#$s,#c,%VarResult%
In this example we split the string "The quick brown fox jumps over the lazy dog" using the delimiter space (in it's escaped form #$s) and get the single words in the separate loop passes. We use the "count" (returned as index=0) to drive the loop command.
This could also be used to get the nth delimited field in string read in from a file.