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);
}
Showing posts with label CharArray in C#. Show all posts
Showing posts with label CharArray in C#. Show all posts
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:
Comments (Atom)