Eiben,

das hier m�sste funktionieren:

ArrayList arrLst;
string[] strarr;

arrLst.Add("[EMAIL PROTECTED]");
arrLst.Add("[EMAIL PROTECTED]");
arrLst.Add("[EMAIL PROTECTED]");

strarr = (string[]) arrLst.ToArray(typeof(string));
string strFinal = String.Join(",", strarr)

Gruss
Remas
http://www.aspalliance.com/remas

----- Original Message -----
From: "Eiben, Thorsten" <[EMAIL PROTECTED]>
To: "aspDEdotnet" <[EMAIL PROTECTED]>
Sent: Wednesday, May 15, 2002 2:34 AM
Subject: [aspdedotnet] RE: Objekt-Referenz


> Hallo Liste,
>
> Weiss jemand wie ich aus einer ArrayList einen comma-separated String
bauen
> kann? Habe folgendes VB-Beispiel gefunden
> (http://www.dotnetbips.com/displayarticle.aspx?id=93):
>
> Dim arrLst As New ArrayList()
> Dim strFinal As String
> Dim strarr() As String
>
> arrLst.Add("[EMAIL PROTECTED]")
> arrLst.Add("[EMAIL PROTECTED]")
> arrLst.Add("[EMAIL PROTECTED]")
>
> strarr = arrLst.ToArray(Type.GetType("System.String"))
> strFinal = String.Join(",", strarr)
>
> Ich brauche das ganze aber in C#. Und C# ist etwas kleinlicher was das
> Casten von Variablen angeht. Das hier:
>
> ArrayList arrLst;
> string[] strarr;
> strarr = new string[3];
>
> arrLst.Add("[EMAIL PROTECTED]");
> arrLst.Add("[EMAIL PROTECTED]");
> arrLst.Add("[EMAIL PROTECTED]");
>
> strarr = arrLst.ToArray(Type.GetType("System.String"));
>
> funzt nicht: Cannot implicitly convert type 'System.Array' to 'string[]'
>
> Also wie bekomme ich einen Array bestehend aus Strings aus dem ArrayList
> heraus?
>
> Th.
>
>
> | [aspdedotnet] als [EMAIL PROTECTED] subscribed
> | http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv
> | Sie k�nnen sich unter folgender URL an- und abmelden:
> | http://www.dotnetgerman.com/listen/aspDEdotnet.asp
>


| [aspdedotnet] als [email protected] subscribed
| http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.dotnetgerman.com/listen/aspDEdotnet.asp

Antwort per Email an