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.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Counts the occurrences of a target character in a given string.
countOccurrences(str: string, targetChar: string): number
string - The input string.string - The character to count occurrences of.number - The number of occurrences of targetChar in str.