![]() ![]() 1 represent that the string searched for is not found. Var regexMatch1 = arch(//g) ĭocument.write("String searched for is found at index ", regexMatch + "") ĭocument.write("String searched for is found at index ", regexMatch1) Using JavaScript Search method to find the index of regular expression Index is for the first occurrence of the string ‘website’. search() method performs a case insensitive search. Var stringSample = "eduCBA has JavaScript Website Development Course which is different from any other website" Using JavaScript Search method to find the index of a case insensitive search Var regexMatch = arch("website") ĭocument.write("String searched for is found at index ", regexMatch) Var stringSample = "eduCBA is a learning website which has various Software development courses" Using JavaScript Search method to find the index of a searched string To find the index of a word in the complete string. arch() searches for ‘o’, ‘B’, ‘e’ in string ‘Google Browser’ and prints the index numbers. Using JavaScript Search method to find the index of a stringĭocument.write("o found at index " + arch(regexString1) + "") ĭocument.write("B found at index " + arch(regexString2) + "") ĭocument.write("e found at index " + arch(regexString3)) To find the index of regular expression in string. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |