Indy 9
BreakApart
Unit: IdGlobal
Separates a string into a list of tokens using a specified delimiter.
function BreakApart(BaseString: string; BreakString: string; StringList: TStrings): TStrings;
Unit
IdGlobal
Parameters
BaseString: string
Values to be broken into tokens.
BreakString: string
Delimiter between tokens in the origin data.
StringList: TStrings
Container for tokens found in the origin data.
Return Value
TStrings - Container for tokens found in the string value.
Description
BreakApart is a TStrings function that separates the values in BaseString into tokens using the delimiter specified in BreakString. Tokens are extracted from BaseString starting at the left-most position, and continuing until no more data remains to be processed in BaseString.

If BreakString does not occur in BaseString, the entire value in BaseString is added to StringList as a single token.

The return value for the function is the argument specified in StringList after tokens have been added to the container.


Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.