Author: David Johannes Rieger In Delphi you can also use the implode and explode methods from PHP: Answer: 1 type 2 TDynStringArray = array of string; 3 4 function Implode(const Glue: string; const Pieces: array of string): string; 5 var 6 I: Integer; 7 begin 8 Result := ''; 9 for I := 0 to High(Pieces) do 10 Result := Result + Glue + Pieces[I]; 11 Delete(Result, 1, Length(Glue)); 12 end; 13 14 function Explode(const Separator, S: string; Limit: Integer = 0): TDynStringArray; 15 var 16 SepLen: Integer; 17 F, P: PChar; 18 begin 19 SetLength(Result, 0); 20 if (S = '') or (Limit < 0) then 21 Exit; 22 if Separator = '' then 23 begin 24 SetLength(Result, 1); 25 Result[0] := S; 26 Exit; 27 end; 28 SepLen := Length(Separator); 29 30 P := PChar(S); 31 while P^ <> #0 do 32 begin 33 F := P; 34 P := AnsiStrPos(P, PChar(Separator)); 35 if (P = nil) or ((Limit > 0) and (Length(Result) = Limit - 1)) then 36 P := StrEnd(F); 37 SetLength(Result, Length(Result) + 1); 38 SetString(Result[High(Result)], F, P - F); 39 F := P; 40 while (P^ <> #0) and (P - F < SepLen) do 41 Inc(P); // nächsten Anfang ermitteln 42 end; 43 end;