In this article, we will write a C# program to find number of occurences of a character in string.
Python Code:
1 2 3 4 5 6 7 8 9 | chars = "abcdefghijklmnopqrstuvwxyz" check_string = "www.python-examples.com" for char in chars: count = check_string.count(char) if count > 0: print (char, count) |
Output: