The input string.
Optionalchar: stringOptional character to count.
Number of characters or character occurrences.
char is provided, only that character’s occurrences are counted.char is omitted, the function counts the number of substrings returned by splitString (similar to a word count).
Counts characters in a string.