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