Count the Number of Duplicate Characters

Code Example - Count the Number of Duplicate Characters

                
                        using System.Linq;

public class Program
{
    public static int DuplicateCount(string str)
    {
			return str.ToCharArray()
				.GroupBy(x => x)
				.Where(x => x.Count() > 1)
				.Count();
    }
}