var chars = "NAMAN"; chars.Distinct().ToList().ForEach(c => Console.WriteLine("{0}={1}", c, chars.Count(i => i == c)));
str.ToCharArray().GroupBy(i => i).OrderBy(k => k.Key).ToList(). ForEach(m => Console.WriteLine(string.Format("{0}: {1}", m.Key, m.Count())));
string charapp = "NAMAN"; string data = charapp.Distinct().Select(m => new { Key = m, Val = charapp.Count(x=> x.Equals(m)).ToString() }). Select(m=> m.Key + ":" + m.Val).Aggregate((a,b)=> a + "\n" + b); Debug.Write(data);
int count = inputstring.Count(f => f == 'N');
int count = inputstring.Split('N').Length - 1;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)