Einzelnen Beitrag anzeigen

Der schöne Günther

Registriert seit: 6. Mär 2013
6.110 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: Verhalten von String.Join bzgl. Array of Const Parameter

  Alt 19. Nov 2020, 14:04
Also wenn ich schreibe String.Join(';', ['A', '1', 'C']); kreidet er mir das an:

Code:
[dcc32 Error] Project1.dpr(10): E2251 Ambiguous overloaded call to 'Join'
  System.SysUtils.pas(4112): Related method: class function TStringHelper.Join(const string; const array of const): string;
  System.SysUtils.pas(4113): Related method: class function TStringHelper.Join(const string; const array of string): string;
Heißt: Er weiß nicht, welche Überladung er nehmen soll.

Mit so etwas ist er dann happy:

Delphi-Quellcode:
   const args: TArray<String> = ['A', '1', 'C'];
   var myText := String.Join(';', args);
  Mit Zitat antworten Zitat