PDA

View Full Version : count the occurrence of a given character in a string ?



islamicastrologer
04-27-2019, 02:12 AM
Hello Dear,

Please Tell Me How do you count the occurrence of a given character in a string ?

MVMinfotech18
04-29-2019, 09:03 PM
Program to count occurrence of a given character in a string. Given a string and a character, task is to make a function which count occurrence of the given character in the string. Examples: Input : str = "geeksforgeeks" c = 'e' Output : 4 'e' appears four times in str.