type
returns
method
number
name
description
needle
string
The substring to search for
Returns the index of the start of the substring in the given string. Returns -1 if not found.
substring
-1
"Hello! Hi!".index("Hi") == 7 "Goats :D".index("Hi") == -1
Last updated 5 years ago
Was this helpful?