[jQuery] Re: newbies question

2008-11-19 Thread Andy Matthews
Assuming there's only a handful of characters that might be at the beginning of the test1 string, you could use a regular expression, like so: var test1 = 'a8'; if (test1.match(/^[abcd]8/)) alert('true'); Run those two lines and you should get an alert box saying 'true'. Change t

[jQuery] Re: newbies question

2008-11-19 Thread Pierre Bellan
Hi, With regular expressions you can simplify it : For example, if ( test1.match(/^[a-z]8$/) ) { } Pierre Lily Tomlin - "The trouble with the rat race is that even if you win, you're still a rat." 2008/11/19 Alfredo Alessandrini <[EMAIL PROTECTED]> > > Hi, > > > Can I simplify this if state