频道分类

Delphi 获取指定字符串后面的所有的字符串

作者:admin 来源: 日期:2019/10/16 10:42:46 人气: 标签:

 


function DeleteUntilLast(const Text, UntilLastStr: string): string;
var
  i: Integer;
begin
  Result := Text;
  i      := pos(UntilLastStr, Result);
  while i > 0 do
  begin
    Delete(Result, 1, i);
    i := pos(UntilLastStr, Result);
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text:=DeleteUntilLast(Edit1.Text,Edit2.Text);
end;