compare string with * character javascript -
is possible compare strings this?:
string1 = "abc/def/ghi/*" string2 = "abc/def/ghi/jkl/mno" if (string1 == string2){ //do sth } i mean - * character on end of string1. in web searchers use * or ?, possible in comparing strings?
not using == sign. if remove * can use indexof
var string1 = "abc/def/ghi/"; var string2 = "abc/def/ghi/jkl/mno"; if (string2.indexof(string1)>=0){ //do sth }
Comments
Post a Comment