本文整理自网络,侵删。
function RemoveWhiteSpaces(const S: String): String;var I: Integer; ch: Char;begin result := ''; for I:=1 to Length(S) do begin ch := S[I]; if ch = ' ' then begin end else if ch = #9 then begin end else result := result + ch; end;end;
procedure TForm1.FormCreate(Sender: TObject);beginshowmessage(RemoveWhiteSpaces(' abc1 23 @16 3.c om ')); //结果 abc123@163.comend;
相关阅读 >>
Delphi 时间与相关类型(2) - tdate、ttime、ttimestamp
Delphixe4 版本中,已针对移动平台 引入了 arc 模型
更多相关阅读请进入《Delphi》频道 >>