Search
 
SCRIPT & CODE EXAMPLE
 

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();
    }
}
Comment

PREVIOUS NEXT
Code Example
Csharp :: dapper get list 
Csharp :: how to set the current user httpcontext.current.user asp.net -mvc 
Csharp :: array in c# 
Csharp :: Get a list of distinct values in List 
Csharp :: c# listview add items horizontally 
Csharp :: c# byte + byte is int 
Csharp :: static constructor in c# 
Csharp :: Palindromic substrings 
Csharp :: tachyons 
Csharp :: run a command line from vb.net app 
Csharp :: string.insert c# 
Csharp :: commit help 
Csharp :: SQLite Parameters 
Csharp :: if or statement c# 
Csharp :: winforms combobox get selected text 
Csharp :: linq select 
Csharp :: c# yield return ienumerable 
Csharp :: how to add arrays in c# 
Csharp :: DateTime restrictions 
Csharp :: how to remove from list from index c# 
Csharp :: add to ienumerable 
Csharp :: wpf dispatcher timer is inaccurate 
Csharp :: vb.net read registry key as string 
Csharp :: rename join ta le in many to many 
Csharp :: How do I identify the referrer page in ASP.NET? 
Csharp :: C# multiple button click event to textbox 
Csharp :: ef6 export update 
Csharp :: c# wpf control to windw size 
Csharp :: c# UserControl make background transparent 
Csharp :: c# aabb box rotate 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =