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 tapplication.onexception

Delphi idhttp下载html的代码(含错误处理)

Delphi 通用压缩单元

Delphi中调用http xml

Delphi 顺序查找与二分查找

Delphi 服务器与客户端的时间同步

Delphi 7中ado控件打开access数据库文件

Delphi indy控件实现网络验证与asp通信

Delphi 得到ip三个值

Delphi 公历转农历函数

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



打赏

取消

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

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

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

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

评论

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