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将文件删除至回收站

Delphi 对image字段存取图片、文件

Delphi ado的事务处理例子

Delphi 截图程序方法

Delphi xe10 给程序添加uac权限

Delphi 获取当前光标处颜色的例子

Delphi 实现dns上线域名解析(用于远控server)

paramstr返回运行当行程序的某个参数

Delphi获取硬件信息

Delphi postmessage 虚拟按键

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



打赏

取消

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

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

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

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

评论

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