تستطيع التقطيع والجمع بواسطة
الدالتين : Explode, implode
المصدر:
الدالتين : Explode, implode
كود :
function Explode(ch: string; sep: string = ';'): TStringList;
var
p: integer;
begin
p := pos(sep, ch);
explode := TStringList.Create;
while p > 0 do begin
explode.Add(copy(ch, 1, p - 1));
if p <= length(ch) then ch := copy(ch, p + length(sep), length(ch));
p := pos(sep, ch);
end;
if length(ch) > 0 then explode.Add(ch);
end;
//------------------------------
function Implode(lst: TStringList; sep: string = ';'): string;
var
i: integer;
s: string;
begin
i := 0;
while i < lst.Count - 1 do begin
s := s + lst[i] + sep;
i := i + 1;
end;
if i < lst.Count then s := s + lst[i]; //Ne mets pas de séparateur sur le dernier élément
result := s;
end;كود :
http://forum.hardware.fr/hfr/Programmation/Delphi-Pascal/string-tokeniser-explode-sujet_21714_1.htm
وإن تقدم ذو تقوى بصالحةٍ *** قدمتُ بين يديه عبرة الندمِ

