UNPKG

@visulima/string

Version:

Functions for manipulating strings.

10 lines (9 loc) 400 B
/** * Get the count of `substring` in `value`. * @param value Content to search in. Will be coerced to string. * @param substring Substring to look for, typically one character. * @returns Count of `substring`s in `value`. * @throws {TypeError} When substring is not a string or is empty. */ declare const countOccurrences: (value: unknown, substring: string) => number; export { countOccurrences };