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 -

excel vba - VBA Proxy auto-configuration for http requests -

php - phpWord - Tables with borders in headers/footers -