本文整理自网络,侵删。
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 十六进制字符串转化成字符串输出hextostr strtohex(Delphi版、c#版)
Delphi 使用firedac tfdibbackup和tfdibrestore备份和还原firebird
Delphi实现win10下Delphi 10.3.1 inline hook 调试器法获取寄存器并修改
Delphi xe5 中tmemo控件的应用――for android
更多相关阅读请进入《Delphi》频道 >>