Delphi 字串擷取

摘要:Delphi 字串擷取

常用筆記
procedure TForm1.Button1Click(Sender: TObject);
var  s1: string;
begin
  s1 := 'EFO123_Delphi_20150115';
  //需uses StrUtils.pas
  ShowMessage(RightStr(s1,8));          //20150115
  ShowMessage(LeftStr(s1,6));           //EFO123
  //使用copy
  ShowMessage(copy(s1,1,6));            //EFO123
  ShowMessage(copy(s1,15,length(s1)));  //20150115

end;

 

 

 

 

 

大家一起加入blogads 賺零用錢!!