String.trim
بازگشت به صفحه اصلی
بازگشت به صفحه مقاله
دو ستونی
دو سطری
اجرای کد RUN »
Result Size: 625 x 717 <!DOCTYPE html> <html> <body> <h2>JavaScript String.trim()</h2> <p>Click the button to alert the string with removed whitespace.</p> <button onclick="myFunction()">Try it</button> <p><strong>Note:</strong> The trim() method is not supported in Internet Explorer 8 and earlier versions.</p> <script> function myFunction() { var str = " Hello World! "; alert(str.trim()); } </script> </body> </html>