Skip to content

Instantly share code, notes, and snippets.

@aleecan
Created May 6, 2015 11:11
Show Gist options
  • Save aleecan/628c2d651dedd5dc1dcc to your computer and use it in GitHub Desktop.
Save aleecan/628c2d651dedd5dc1dcc to your computer and use it in GitHub Desktop.

Revisions

  1. aleecan created this gist May 6, 2015.
    13 changes: 13 additions & 0 deletions username letter validation
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    function isLetters(un){
    var a=un;
    var count=0;
    for (var i = a.length - 1; i >= 0; i--) {
    if ((a.charCodeAt(i)>64 && a.charCodeAt(i)<91) || (a.charCodeAt(i)>96 && a.charCodeAt(i)<123) ) {
    count++;
    };
    };
    if (count!=a.length) {
    return false;
    };
    return true;
    }