- 人气:
- 放大
- 缩小
- 二维码
- 赞赏
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;