function T_SunnySky_SDK.JoinItems(AParamDic: TDictionary<string, string>): string;
var
sb : TStringBuilder;
key : TPair<string,string>;
begin
if not Assigned(AParamDic) then
Result := ''
else if AParamDic.Count = 0 then
Result := ''
else begin
sb := TStringBuilder.Create;
try
for key in AParamDic do
begin
if sb.Length > 0 then
sb.Append('&'); sb.Append(key.Key);
sb.Append('=');
sb.Append(HTTPEncode(key.Value));
end; Result := sb.ToString;
finally
sb.Free;
end;
end;
end;
Delphi 的 TStringBuilder 可以完美实现Jave ,C#的TStringBuilder功能. :)