A string's indexer returns a single character at the given index.
The indexing is is zero-indexed:
using System; class MainClass{//from w w w . j a v a2s . c o m public static void Main(string[] args){ string str = "abcde"; char letter = str[1]; // letter == 'b' } }
string implements IEnumerable<char>, so you can foreach over its characters:
using System; class MainClass{/*from www . ja v a2 s . c om*/ public static void Main(string[] args){ foreach (char c in "123") Console.Write (c + ","); // 1,2,3, } }