delphi 两字符串之间添加分隔符


本文整理自网络,侵删。

 
function AddStr(const Str: string; const AdditionalStr: string; const DelimiterStr: string): string;
begin
  if Str = EmptyStr then
  begin
    Result := AdditionalStr;
  end
  else
  begin
    Result := Str + DelimiterStr + AdditionalStr;
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
Memo1.Text:=AddStr('123----456----789','8888','----');
//原始数据:
//123----456----789
//处理后
//123----456----789----8888
end;

相关阅读 >>

Delphi 清空某个form的控件内容,用tag来判断

Delphi idftp连接

Delphi线程中关闭程序

Delphi 禁止截屏printscreen

Delphi 调用golang dll

Delphi关于tjpegimage的使用(bmp\ jpg格式转换)

Delphi 10.2 新特性之―tfdbatchmovejsonwriter

Delphi 遍历硬盘所有文件目录

Delphi system.netencoding

Delphi 获得父目录�c指定级父目录

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



打赏

取消

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

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

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

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

评论

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