Delphi : Metni bölmek – explode

type
  TStrArray = array of string;
function Explode(var a: TStrArray; Border, S: string): Integer;
var
  S2: string;
begin
  Result  := 0;
  S2 := S + Border;
  repeat
    SetLength(A, Length(A) + 1);
    a[Result] := Copy(S2, 0,Pos(Border, S2) - 1);
    Delete(S2, 1,Length(a[Result] + Border));
    Inc(Result);
  until S2 = '';
end;
procedure TForm1.btn1Click(Sender: TObject);
var 
A:TStrArray;
metin:string;
begin
metin:= 'elma,armut,üzüm';
 
Explode(A, ',', metin);
 
showmessage(A[1]);
// sonuç armut;
end;

Yorum Yap


Not - Bunları KullanabilirsinizHTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">