# Module: occurrences
Returns the number of times that a substring search
appears in a string input
.
import { occurrences } from 'utilist';
occurrences('mississippi', 'i'); // returns 4
occurrences('mississippi', 'ssi'); // returns 2
# Functions
# occurrences
▸ occurrences(input
: string, search
: string): number
Defined in src/occurrences.ts:19
Parameters:
Name | Type | Description |
---|---|---|
input | string | The string to search in. |
search | string | The substring to be searched. |
Returns: number