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

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -