using System.Collections.Generic;
public static void Main()
string input = "WWW.C-SHARPCORNER.COM ";
public static void GetOccurance(string input)
char[] charArr = input.ToCharArray();
Dictionary<char, int> keyresult = new Dictionary<char, int>();
List<char> charLst = new List<char>();
for (int i = 0; i < charArr.Length; i++)
if (keyresult != null && !keyresult.ContainsKey((charArr[i])))
keyresult.Add(charArr[i], count++);
Console.WriteLine(keyresult.ToString());