TypeScript String indexOf()
Syntax & Examples


Syntax of String.indexOf()

The syntax of String.indexOf() method is:

indexOf(searchString: string, position?: number): number

This indexOf() method of String returns the position of the first occurrence of a substring.