Finding
indexof
The indexof method returns the position of the first occurrence of a specified value in a string
This returns -1 if the value does not exist.
This method is case sensitive.
lastindexof
The lastindexof method returns the position of the last occurrence of a specified value in a string
This returns -1 if the value does not exist.
This method is case sensitive.
search
Returns the character position
var indexOfA = myString.search("A");
var indexOfK = myString.search("K");
startswith
2 parameters
endswith
2 parameters
myString.endswith(searchstring, endposition)
endposition - where the search ends
includes
Returns true or false
myString.includes("A")
© 2023 Better Solutions Limited. All Rights Reserved. © 2023 Better Solutions Limited TopPrevNext