RAD Studio VCL Reference
SysUtils.LastDelimiter Function

Returns the byte index of the last character that matches any character in a specified set of delimiters.

function LastDelimiter(const Delimiters: string; const S: string): Integer; overload;
int LastDelimiter(const AnsiString Delimiters, const AnsiString S);

Call LastDelimiter to locate the last delimiter in a specified string. 

Delimiters is a string where each character is a valid delimiter. 

S is the string to search for delimiters. 

For example, the line 

MyIndex := LastDelimiter('\.:','c:\filename.ext'); // Delphi 

MyIndex = LastDelimiter("\\.:","c:\\filename.ext"); // C++ 

sets MyIndex to 12. 

When working with multi-byte character sets (MBCS), S may contain double byte characters, but the delimiters listed in the Delimiters parameter must all be single byte non-null characters. 


Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!