Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Char[] to string
Message
De
10/08/2005 13:12:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
10/08/2005 12:58:46
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01039893
Message ID:
01039932
Vues:
24
Hard to remember not only the classes to use but the static ones as well from within thousands of them:( I wouldn't be surprised if someone comes up with an overloaded ToString() :)
Cetin

>Even better, Cetin, would be to use the static methods (so you don't need to instantiate a class):
>
>
>string myString = System.Text.ASCIIEncoding.ASCII.GetString(ascii.GetBytes(ca));
>
>
>~~Bonnie
>
>
>
>>>There has to be an easier method to convert a char array to a string. Currently I loop through the char array and build my string on char at the time.
>>>
>>>char[] ca = new char[3];
>>>ca[0] = 'a';
>>>ca[1] = 'b';
>>>ca[2] = 'c';
>>>
>>>string myString = "";
>>>for (int i = 0; i<ca.Length;i++)
>>>{
>>>  myString = myString + ca[i].ToString();
>>>}
>>>
>>>
>>>Einar
>>
>>
>>System.Text.ASCIIEncoding ascii = new System.Text.ASCIIEncoding();
>>
>>string myString = ascii.GetString(ascii.GetBytes(ca));
>>
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform