本文整理自网络,侵删。
function DeleteLineBreaks(const S: string): string;varSource, SourceEnd: PChar;beginSource := Pointer(S);SourceEnd := Source + Length(S);while Source < SourceEnd dobegin case Source^ of #10: Source^ := #32; #13: Source^ := #32; end; Inc(Source);end;Result := S;end;
补充第二种方法:function DeleteLineBreaks(const S: string): string;beginResult := StringReplace(S, #13#10, '',[rfReplaceAll]);end;
相关阅读 >>
Delphi 实现dns上线域名解析(用于远控server)
更多相关阅读请进入《Delphi》频道 >>