본문 바로가기

Web For All

JS 한글 문자열 길이 구하기

function getStringLength(str){
    return (str.length+ (escape(str)+"%u").match(/%u/g).length- 1);
}