Question: Implement the function Searchingstrings that allow to search a sub-string in a given string and display the: First occurrence, Last occurrence, First occurrence from a
Implement the function Searchingstrings that allow to search a sub-string in a given string and display the: First occurrence, Last occurrence, First occurrence from a given index and Last occurrence from a given index. You can use the following String methods: string. IndexOf(searchvalue, start) return the position of the first occurrence of specified character(s) in a string. string.lastIndexOf(searchvalue, start) return the position of the last occurrence of specified character(s) in a string. You can use the following string to test your solution: var letters = "abcdefghijklmnopqrstuvwxyzabcdefghijklm";
Write the JS code in a separate file.
Write the html code in a separate file.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
