Skip to main content

Signature

path=null start=null
countOccurrences(str: string, targetChar: string): number

Parameters

  • str: string - The input string.
  • targetChar: string - The character to count occurrences of.

Returns

number - The number of occurrences of targetChar in str.

Source

Defined in string.ts:123