private static void String2CharArray() { string s1 = "This is a string"; Char[] ArrayofChars; ArrayofChars = s1.ToCharArray(); Console.WriteLine(s1); foreach (char c1 in ArrayofChars) Console.WriteLine(c1); }
Tuesday, June 21, 2011
How to Convert a String to Array of Characters
The following snippet converts a string to a Character Array using CharArray
Subscribe to:
Post Comments (Atom)
or you could implment it with linq.
ReplyDeletevar charArray = ("mystringvalue").ToArray();