Signature
path=null start=null
Parameters
- str:
string- The input string. - targetChar:
string- The character to count occurrences of.
Returns
number - The number of occurrences of targetChar in str.
Counts the occurrences of a target character in a given string.
string - The input string.string - The character to count occurrences of.number - The number of occurrences of targetChar in str.