Here I'm going to show simple way to count the occurrence of each character in a string using a console application. lets think the given string is "ssmmmjjkkkkrrr". so there are 2 s's, 3 m's,2 j's, 4 k's, and 3 r's.
Here is the code :
Here is the results:
No comments:
Post a Comment