Find the position

Report a typo

Given two strings, find the position of the variable searchStr in the txt string. Use the appropriate string methods to do this and print the position of searchStr.

Sample Input 1:

Sample Output 1:

11
Write a program in JavaScript
let txt = "I slit the sheet, the sheet I slit, and on the slitted sheet I sit";
let searchStr = "sheet";
___

Create a free account to access the full topic