Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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();
    }
}
Source by edabit.com #
 
PREVIOUS NEXT
Tagged: #Count #Number #Duplicate #Characters
ADD COMMENT
Topic
Name
2+2 =