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.
String Compare
Find the position
Report a typo
Sample Input 1:
Sample Output 1:
11Write a program in JavaScript
let txt = "I slit the sheet, the sheet I slit, and on the slitted sheet I sit";
let searchStr = "sheet";
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.