indexof
nounUK /ˈɪndeks ɒv/
US /ˈɪndeks əv/
A way to find where something is in a list.
Use indexof to find the position of the letter in the word.
OTHER MEANINGS
2. A programming function that tells you the first place a value appears in a string or list.
The indexof function returned 3 because the letter first appears at position three.
3. A method that gives back -1 when the item cannot be found.
If the word is missing, indexof gives back -1.
4. A tool for checking whether one piece of text contains another.
She used indexof to check if the sentence had the word cat.