indexOf

.indexOf( search )

Searches for the given 'search' string, and returns the position that it is found. This index starts at 0. Otherwise if it is not found, then -1 is returned.

index = "xyz abc".indexOf( "xyz" ) // returns  0
index = "xyz abc".indexOf( "abc" ) // returns  4
index = "xyz abc".indexOf( "xxx" ) // returns -1