Delphi 合并字符串的函数


本文整理自网络,侵删。

 
function Join(mylist: TStrings; seperatorStr: string): string;
var
  i: Integer;
begin
  Result := string.Empty;
  for i := 0 to mylist.Count - 1 do
  begin
    Result := Result + mylist[i];
    if i < mylist.Count - 1 then
      Result := Result + ' ' + seperatorStr + ' ';
  end;
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
memo2.Text:=Join(memo1.Lines,edit1.Text);
end;


相关阅读 >>

Delphi xe5 android平台 调用 webservice

Delphi tooltip提示窗口单元

Delphi 10.4.1的编译器bug终于修正了!

Delphi 删除或清除tstringgrid中的行

Delphi 日期字符串转换日期格式

Delphi adotable1 链接mdb数据库

Delphi udp文件传输

Delphi strutils.dupestring - 反复字符串

Delphi 跨平台的,在fmx中读取icon文件的每一帧到bitmap

Delphi idtcp上传文件

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



打赏

取消

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

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

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

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

评论

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