delphi截取指定字符空格或-符号前面 中间 后面字符串
Edit1.Text:='abcd-12ab-59cd';
procedure TForm1.Button1Click(Sender: TObject);
procedure TForm1.Button1Click(Sender: TObject);
var
List: TStringList;
begin
List := TStringList.Create;
List.Delimiter := '-';
List.DelimitedText :=Trim(Edit1.Text);
ShowMessage(IntToStr(List.Count)); //2
ShowMessage(List[0]); //abcd
ShowMessage(List[1]); //12ab
ShowMessage(List[2]); //12ab
List.Free;
end;