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 statement?
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
2 matches
Mail list logo