GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — JavaScript String trim() Method - GeeksforGeeks JavaScript String trim() MethodLast Updated : 16 Jan, 2026 The trim() method is used to remove extra spaces from a string. It helps clean user input by removing unwanted whitespace.
Syntaxstr.trim();ParametersThis method does not accept any parameter. Return valueReturns a new string without any of the leading or trailing white spaces. [Example 1]: Trimming Whitespace from the End of a String.
[Example 2]: Trimming Leading Whitespace from a String
Output GeeksforGeeks [Example 3]: Trimming Whitespace from both sides of String
Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |