Joel
after using TCL the best things were split and join
you can use this
procedure Split(const S: string; List: TStrings; Sep: char); overload;
var
i, StartPos, Pos: integer;
begin
StartPos := 1;
Pos := 1;
for i := 1 to Length(S) do
begin
if (S[i] = Sep) or (i = Length(S)) then
if StartPos = Pos then
begin
Pos := i+1;
if Pos = Length(S)+1 then inc(Pos);
List.Add(copy(S,StartPos,Pos-StartPos-1));
StartPos := Pos;
end;
end;
end;
----- Original Message -----
From: Joel van Velden <[EMAIL PROTECTED]>
To: Multiple recipients of list delphi <[EMAIL PROTECTED]>
Sent: Thursday, 12 April 2001 15:35
Subject: [DUG]: Parser
> A newbie question:
>
> How is it possible / what is the best way to turn a string containing
> 'special' characters into an array?
>
> IE : 'Happy|Birthday|to|you' becomes
> Happy
> Birthday
> to
> you
>
> (inside an array)
>
> TIA
> -Joel
>
> --------------------------------------------------------------------------
-
> New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
> Website: http://www.delphi.org.nz
> To UnSub, send email to: [EMAIL PROTECTED]
> with body of "unsubscribe delphi"
>
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED]
with body of "unsubscribe delphi"