Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Char[] to string
Message
From
10/08/2005 13:12:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
10/08/2005 12:58:46
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
01039893
Message ID:
01039932
Views:
25
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform