static void Main(string[] args) { var s = new MySentence(); { Console.WriteLine(s[3]); } Console.Read(); }
static void Main(string[] args) { Console.WriteLine("***Exploring Indexers.Example-1***\n"); string mySentence = "This is a nice day."; MySentence sentenceObject = new MySentence(mySentence); for (int i = 0; i < mySentence.Split().Length; i++) { Console.WriteLine("\t sentenceObject[{0}]={1}", i, sentenceObject[i]); } Console.ReadKey(); }