Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming
photo of Zarko Gajic

Zarko's Delphi Programming Blog

By Zarko Gajic, About.com Guide to Delphi Programming since 1998

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

August 25, 2008 at 8:20 am
(1) Griff says:

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)

August 26, 2008 at 10:02 pm
(2) I Greed says:

How about …

function FirstDelimiter(const Delimiters, S: string): Integer;

begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;

;-)

August 29, 2008 at 2:16 pm
(3) didierhtm says:

Hi,

>>function FirstDelimiter(const Delimiters, S: string): Integer;
begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;

August 29, 2008 at 6:54 pm
(4) didier says:

>>function FirstDelimiter(const Delimiters, S: string): Integer;
begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;

August 29, 2008 at 6:56 pm
(5) didier says:

function FirstDelimiter(const Delimiters, S: string): Integer;
begin
Result := LastDelimiter(Delimiters, ReverseString(S))
end;

Not sure this gets what expected

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

Discuss

Community Forum

Explore Delphi Programming

About.com Special Features

Delphi Programming

  1. Home
  2. Computing & Technology
  3. Delphi Programming

©2009 About.com, a part of The New York Times Company.

All rights reserved.