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 -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

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