/** * 한글 마지막 글자의 중성 유무를 체크합니다. * * ex ) var str = "사탕"; * if (isFinalConsonant(str)) { * window.alert(str+"을 먹었습니다."); * } * else { * window.alert(str+"를 먹었습니다."); * } */ function isFinalConsonant(str) { var strtemp = str.substr(str.length-1); if ((strtemp.charCodeAt(0)-16)%28!=0) return true; else return false; }
'Programming > Script' 카테고리의 다른 글
[Text] 홈페이지 형식 체크 (0) | 2010.01.19 |
---|---|
[Text] 메일 형식 체크 (0) | 2010.01.19 |
[Cookie] Cookie Set/Get function (0) | 2010.01.19 |
[CheckBox] CheckBox Checked All(on/off) (0) | 2010.01.19 |
[Document] getElement (0) | 2010.01.19 |