Advertisement
Guest User

Untitled

a guest
Aug 17th, 2015
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1.       private void readFile()
  2.         {
  3.             var query = File.ReadLines(openFileDialog1.FileName).Where(line => !String.IsNullOrEmpty(line))
  4.                                         .GroupBy(line => line.First());
  5.             charFreq();
  6.         }
  7.  
  8.         private void charFreq()
  9.         {
  10.             var charFreq =
  11.                 from c in line.ToCharArray()
  12.                 group c by c into groupFrequencies
  13.                 select groupFrequencies;
  14.  
  15.             foreach (var c in charFreq)
  16.                 rTxtOutput.Text += (String.Format("{0} : {1}", c.Key, c.Count())) + "\r\n";
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement