string s = "HVWGWGHVSPSGHQCADIHSFSLSFQWGSWVOJSSJSFSLDSFWSBQSR"; int[] freq = new int[26]; for (int i = 0; i < s.Length; i++) { // converting string temp = s.Substring(i, 1); // converting to an array int itemp = (int)temp.ToCharArray()[0]; freq[itemp - 65]++; } for (int i = 0; i < 26; i++) { Console.WriteLine(i + " " + freq[i]); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)