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 gethomepath - 获取用户程序数据目录

Delphi开发linux的动态库

Delphi 用代码实现为程序创建快捷方式的二种方法

Delphi 如何获得其他进程的token

shellexecute()和winexec()区别

Delphi下firedac连接mysql数据库零起点

Delphi datasnap清除僵死连接

Delphi 获取文件大小根据显示gb mb kb b

Delphi xe程序的主题(theme)设置

Delphi xe ioutils tpath(结构体) 的方法与属性

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



打赏

取消

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

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

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

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

评论

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