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";
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here