How to

convert string to char array and vice versa

Published: 15. February 2012 | Updated: 15. February 2012
License: Microsoft Public License (MS-PL)
Categories: Framework » Strings
Tags: Array Basics C# Text
Was this snippet helpful for you? YESYES / NONO
string text = "test";

// string to chars
char[] charsArray = text.ToCharArray();

// chars to string
string textAgain = new string(charsArray);
Send us feedback about this snippet »



Related Snippets: