The Old Count Letters with Regex example

static void RegexMatchesComplex(string str)
{            
         char[] letters = str.ToCharArray().Distinct().ToArray();
         foreach (char c in letters)            
        {
              Regex regex = new Regex(c.ToString());                
              Console.WriteLine(c.ToString() + " " + regex.Matches(str).Count);            
         }        
}

Comments

Popular posts from this blog

c# Service Play Sound with NAudio example by Moshe

JS/JQ simulate Enter event

SOLVED The item could not be indexed successfully because the item failed in the indexing subsystem