코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>JavaScript String Method</title> </head> <body> <h1>문자열 주위의 공백 제거</h1> <script> var str = " JavaScript "; document.write(str.trim()); </script> </body> </html>