Windows Phone Developers

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

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);
        }
Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon