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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

SQL Server - MyCTE query based on 24 hour period (next day) -

php - Using str_replace to translate a MySQL Table in html -