Skip to content

@technobuddha > library > String > Operations

Function: count()

ts
function count(
   input: string, 
   substring: string, 
   options: CountOptions): number;

Defined in: count.ts:20

Compute the number of times a substring occurs within a string

Parameters

ParameterTypeDescription
inputstringThe string
substringstringThe substring to look for
optionsCountOptionssee CountOptions

Returns

number

number of times substring occurs within input