本文整理自网络,侵删。
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 弹出输入框的inputquery, inputquery 函数用法
Delphi 按字符串长度对tstringlist的元素进行排序
Delphi strtofloat 将“字符型”转换成“浮点型”
更多相关阅读请进入《Delphi》频道 >>