Topic Path: Symbol Reference > Functions > BreakApart Function
ContentsIndexHome
PreviousUpNext
BreakApart Function

Separates a string into a list of tokens using a specified delimiter.

File
function BreakApart(
    BaseString: string; 
    BreakString: string; 
    StringList: TIdStrings
): TIdStrings;
Parameters 
Description 
BaseString 
Values to be broken into tokens.
 
BreakString 
Delimiter between tokens in the origin data.
 
StringList 
Container for tokens found in the origin data. 

TIdStrings - Container for tokens found in the string value.

BreakApart is a TIdStrings 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. 

Each token located in BaserString is added to the container in StringList, and both the token and the delimiter in BreakString are removed from BaseString. 

If BreakString does not occur in BaseString, the entire value in BaseString is added to StringList as a single token, and removed from the data to be processed in BaseString. 

The process repeats until no more BreakString delimiters are found in BaseString, or until no more unprocessed data remains in BaseString. 

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

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.