c# - How to find out the duplicate characters in a string? -


this question has answer here:

i take string integer count

int count=0; string s="wow" 

and using foreach loop count number of characters in specified string

foreach(char ch in s) {  count++ } 

so how can count characters repeated in string 'w'.

try )

string test = "aababc";         var result = test.groupby(c => c).where(c => c.count() > 1).select(c => new { charname = c.key, charcount = c.count()}); 

Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -

Why does a .NET 4.0 program produce a system.unauthorizedAccess error on a Windows Server 2012 machine with .NET 4.5 installed? -