delphi 合并文本行的函数


本文整理自网络,侵删。

 
function DeleteLineBreaks(const S: string): string;
var
Source, SourceEnd: PChar;
begin
Source := Pointer(S);
SourceEnd := Source + Length(S);
while Source < SourceEnd do
begin
   case Source^ of
     #10: Source^ := #32;
     #13: Source^ := #32;
   end;
   Inc(Source);
end;
Result := S;
end;


补充第二种方法:
function DeleteLineBreaks(const S: string): string;
begin
Result := StringReplace(S, #13#10, '',[rfReplaceAll]);
end;

相关阅读 >>

Delphi tstatusbar 用来显示当前程序状态的

Delphi 十六进制字符串转化成字符串输出hextostr strtohex(Delphi版、c#版)

Delphi 操作webbrowser 元素值

Delphi 使用firedac tfdibbackup和tfdibrestore备份和还原firebird

Delphi 最精简的小写金额转大写的函数

Delphi实现win10下Delphi 10.3.1 inline hook 调试器法获取寄存器并修改

Delphi中webbrowser自动登录路由器网页

Delphi memo 控件光标定位

Delphi xe5 中tmemo控件的应用――for android

Delphi xe2 - 点点滴滴

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...