用Copy和Pos自己写一个。function GetString(SrcStr, SprStr: String): String; var Index: Integer; begin Result:= ''; while True do begin Index:= Pos(SprStr, SrcStr); if Index = 0 then begin Result:= Result + SrcStr; Break; end; Result:=Result + Copy(SrcStr, 1, Index - 1); SrcStr:= Copy(SrcStr, Index + Length(SprStr), Length(SrcStr)); end; end;procedure TForm1.A1Click(Sender: TObject); begin Edit2.Text:= GetString(Edit1.Text, ','); end;
var Index: Integer;
begin
Result:= '';
while True do
begin
Index:= Pos(SprStr, SrcStr);
if Index = 0 then
begin
Result:= Result + SrcStr;
Break;
end;
Result:=Result + Copy(SrcStr, 1, Index - 1);
SrcStr:= Copy(SrcStr, Index + Length(SprStr), Length(SrcStr));
end;
end;procedure TForm1.A1Click(Sender: TObject);
begin
Edit2.Text:= GetString(Edit1.Text, ',');
end;