Skip to content

strCount

Returns the number of times the second String argument is contained in the first String argument.

Parameters

NameTypeRequiredDefault
strstringStringstr
searchstringStringstr

Returns

number

int

Examples

javascript
strCount('abcabc', 'a'); // Returns 2
dart
strCount('abcabc', 'a'); // Returns 2
python
strCount('abcabc', 'a')  # Returns 2

Released under the MIT License