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之声音资源(*.res)的编译方法

Delphi 查看 dll 的输出函数列表

Delphi 去掉警告

Delphi 如何禁止用户更改窗体的大小

Delphi memo1自动循环上下滚屏

Delphi 播放背景音乐

Delphi窗体固定在桌面上

Delphi 隐藏进程的单元 unit hideprocess.pas

Delphi xe10.1 引用计数

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



打赏

取消

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

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

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

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

评论

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