코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript String Object</title> </head> <body> <h1>문자열의 길이</h1> <script> var strKor = "한글"; var strEng = "abcABC"; document.write(strKor.length + "<br>"); // 2 document.write(strEng.length); // 6 </script> </body> </html>