本文整理自网络,侵删。
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中url的编码与解码,即urlencode的使用
Delphi中strtodatetime函数tformatsettings参数的使用
Delphi windows 编程[18] - 更换菜单项: modifymenu
更多相关阅读请进入《Delphi》频道 >>