/ Published in: JavaScript

Checks if the first char of a string is a : letter, number, dot ( . ), arond ( @ ), underscore ( _ ).
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function isLetter($a) { $inta=$a.charCodeAt('0'); if($inta>=97&&$inta<=122) return true; return false; } function isNumber($a) { $inta=$a.charCodeAt('0'); if($inta>=48&&$inta<=57) return true; return false; } function isDot($a) { if($a.charCodeAt('0')==46) return true; return false; } function isArond($a) { if($a.charCodeAt('0')==64) return true; return false; } function isUnderscore($a) { if($a.charCodeAt('0')==95) return true; return false; }
Comments
