Skip to main content

indexOf

Retrieves the index of first occurrence of a substring in a string.

indexOf(searchString, substring)

Parameters#

  • searchString: The string to search within
  • substring: The string to find in searchString

Returns#

  • The index within searchString of the first occurrence of the specified substring.