What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-12 08:38:24
js find index of string in string
// Find the index of a string in a given sentence function findNemo(sentence) { let indexOfFirst = sentence.split(' ').indexOf('Nemo') + 1; if(indexOfFirst >= 0){ return `I found Nemo at ${indexOfFirst}!`; } return ("I can't find Nemo :(&quo... Add solution