Time for action – let's see whether it works

Follow the given step:

  1. Add the following code snippet in the Main() method:
    static void Main(string[] args) { //Save the T9.txt file in the applications bin/debug directory. StreamReader sr = new StreamReader("T9.txt"); Console.WriteLine("Enter the word or phrase"); string word = Console.ReadLine(); //Stores the histogram of the current given word SortedList<char, int> soughtWordHistogram = GetWordHistogram(word); //Stores histogram of all words in the SortedList SortedList<string, SortedList<char, int>> allWordHistogram = new SortedList<string, SortedList<char, int>>(); string line = string.Empty; while ((line = sr.ReadLine()) != null) { foreach (string w in line.Split(' ')) { string x = w.Trim(); if(x.Length ...

Get .NET 4.0 Generics now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.