本文整理自网络,侵删。
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 comparestr 这个函数可以模糊匹配,且不区分大小写
Delphi application.processmessage作用
Delphi 使用tmemorystream保存多张图片到文件,并读取
更多相关阅读请进入《Delphi》频道 >>