Task 2: Using XHTML and JavaScript you have create a web page Implement the function Searchingstrings that allow to search a sub-string in a given string and display the: First occurrence, Last...



Task 2:


Using XHTML and JavaScript you have create a web page


Implement the functionSearchingstrings 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 thefirst occurrence of specified character(s) in a string.



string.lastIndexOf(searchvalue, start) return the position of thelast occurrence of specified character(s) in a string.


You can use the following string to test your solution:



var letters = "abcdefghijklmnopqrstuvwxyzabcdefghijklm";



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here