本文整理自网络,侵删。
procedure ExtractString(var Scores, LeftValue: String); var i: Integer; begin // 提取左侧内容 i := Pos(#9, Scores); //#9表示tab键 if (i > 0) then begin LeftValue := Copy(Scores, 1, i - 1); Delete(Scores, 1, i); end else begin LeftValue := Scores; Scores := ''; end; end;
procedure TForm1.Button1Click(Sender: TObject);varleftstr:String;str1:String;beginstr1:='123456793NAME_58494178AAA';ExtractString(str1,leftstr);Memo1.Text:=leftstr;
end;
相关阅读 >>
Delphi sysutils.strcopy、sysutils.strecopy
更多相关阅读请进入《Delphi》频道 >>