ms.buggy Posted April 22, 2010 Share Posted April 22, 2010 Hello, I'm trying to check if the variable starts with certain digits, possible begins are +367 and +352. I tried to set if set something like this: if ((gsm.charAt(0)!="+" && gsm.charAt(1)!=3 && gsm.charAt(2)!=6 && gsm.charAt(3)!=7) || (gsm.charAt(0)!="+" && gsm.charAt(1)!=3 && gsm.charAt(2)!=5 && gsm.charAt(3)!=2)){ Can someone help me with this issue? Quote Link to comment Share on other sites More sharing options...
JAY6390 Posted April 22, 2010 Share Posted April 22, 2010 You should use a regular expression to get a match. Also why are you using charAt? That's not PHP that's javascript Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.