• Returns the index of the first occurrence of a value in a string, else returns -1.

    Parameters

    • str: string
    • searchElement: string

      The value to locate in the string.

    • Optional fromIndex: number

      The string index at which to begin the search. If fromIndex is omitted, the search starts at index 0.

    Returns number