FirstDelimiter Delphi Function - Index of the First Occurence in a String of the Characters Specified
Monday August 25, 2008
in Delphi TIPS :: In the RTL there's a LastDelimiter function which returns the index of the last occurence in a string of the characters cpecified.
What about the first delimiter - a function that would return the index of the first occurence in a string of the characters cpecified.
Read the full article to learn how implement FirstDelimiter Delphi Function.
Related:


Comments
for use with comma separated (delimited) strings, try
iSomeInteger:= POS(’,',SomeStr);
This returns the first “Position” of a comma in a string… (only the first)
How about …
function FirstDelimiter(const Delimiters, S: string): Integer;
begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;
;-)
Hi,
>>function FirstDelimiter(const Delimiters, S: string): Integer;
begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;
>>function FirstDelimiter(const Delimiters, S: string): Integer;
begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;
function FirstDelimiter(const Delimiters, S: string): Integer;
begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;
Not sure this gets what expected