分割 '12,11212,q,qweqwe,qw'; ExtractStrings

procedure TForm1.Button1Click(Sender: TObject);
var
 tList: TStringlist;
s1: string;
l: Integer;
begin
try

    s1 := '12,11212,q,qweqwe,qw';
    tList := TStringList.Create;
    try
      l := ExtractStrings([','], [], pchar(s1), tList);
      Memo1.Lines.Add(tList.Strings[0]);
      Memo1.Lines.Add(tList.Strings[1]);
      Memo1.Lines.Add(tList.Strings[2]);
      Memo1.Lines.Add(tList.Strings[3]);
      Memo1.Lines.Add(tList.Strings[4]);
    finally
      tList.Free;
    end;
finally
end;
end;

本文出自 “601880” 博客,转载请与作者联系!

你可能感兴趣的:(职场,休闲)