Click here to Skip to main content
15,880,796 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
How to convert any array of char to string format???
Posted
Updated 11-Oct-12 9:35am
v2
Comments
Sergey Alexandrovich Kryukov 11-Oct-12 17:13pm    
What's broken? MSDN? Google? Bing?
--SA

Easiest way is just use the string constuctor:
C#
var chars = new[] {  'a', 'b', 'c', 'd'  };
var str = new string(chars);
 
Share this answer
 
Comments
ridoy 11-Oct-12 15:45pm    
+5
//chars is ur char array
C#
string s = new string(chars);
 
Share this answer
 
v2
C#
char[] chars = { 'a', 'b', 'c', 'd' };
string[] str = new string[chars.Length];
for (int i = 0; i < chars.Length; i++)
{
    str[i] = chars[i].ToString();
    Console.WriteLine(str[i]);
}
Console.ReadLine();
 
Share this answer
 
Comments
CPallini 11-Oct-12 15:35pm    
Uhm...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900