Given two strings, return the index of the first occurrence of s2 in s1. If there is no occurrence, return -1.
// input:
const s1 = 'hello world', s2 = 'world'
// output:
6
(Ctrl + ')
Loading...
/* output */
Next(Ctrl + y)
Given two strings, return the index of the first occurrence of s2 in s1. If there is no occurrence, return -1.
// input:
const s1 = 'hello world', s2 = 'world'
// output:
6
/* output */