Counts how many times a character appears in a string.
The string to search.
The character to count.
The number of occurrences.
countOccurrence('hello world', 'l'); // 3 Copy
countOccurrence('hello world', 'l'); // 3
Counts how many times a character appears in a string.