Mega Code Archive

 
Categories / C# Book / 01 Language Basics
 

0125 Indexer

Indexer is for accessing a list of value. Indexer is accessed by using the index. The following code uses the indexer from buildin type string to access each char inside a string. using System; class Program { static void Main(string[] args) { string str = "rntsoft.com"; Console.WriteLine(str[2]); } } The output: v