Javascript find if english alphabets only

Posted by Alec Smart on Stack Overflow See other posts from Stack Overflow or by Alec Smart
Published on 2010-03-08T16:37:42Z Indexed on 2010/03/08 16:51 UTC
Read the original article Hit count: 200

Filed under:
|

Hello,

Am trying to find some text only if it contains english letters and numbers using Javascript/jQuery.

Am wondering what is the most efficient way to do this? Since there could be thousands of words, it should be as fast as possible and I don't want to use regex.

 var names[0] = 'test';
 var names[1] = '???';
 var names[2] = '??????';

 for (i=0;i<names.length;i++) {
    if (names[i] == ENGLISHMATCHCODEHERE) {
        // do something here
    }
 }

Thank you for your time.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery