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动态创建一个ipedit控件

Delphi toolbar按钮添加图标

高手谈做程序员的8大基本原则

Delphi 拖动form上的图片,form一起动

Delphi 截取某个字符之前的字段

Delphi fmx jpg 保存数据库 从数据库读取

Delphi从trichedit获得rtf格式文本

Delphi 判断字符串是否相同

Delphi 获取文件夹路径最后一级文件夹目录名称

Delphi xe8 为image设置渐变效果

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



打赏

取消

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

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

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

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

评论

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