![]() ![]() And if not match is found, console prints -1. If match is found, the index of the string is printed in the console. Illustrated few examples of implementing JavaScript search() method. We have seen its definition and its syntax. With this, we come to a conclusion of our topic ‘JavaScript search’. The simplest way to search for a string is without using regular expression. search() cannot perform global match, only finds first match and gives the index number. search method does not consider \g in the regular expression as. search method performs a case sensitive search. If search_value is not found in string, it will return -1.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |