11
How to Remove Trim Whitespaces in JavaScript?

How to Remove Trim Whitespaces in JavaScript?

11 months ago
raja $E6q15ilGNP

The easiest way to trim whitespace from both ends of a string is to use the trim() method.

https://www.rajamsr.com/javascript-string-trim/

let name = " John Doe ";

let trimmedName = name.trim(); // Output: "John Doe"

Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
25 minutes ago
Reputation
0
Spam
0.000
Last Seen
8 minutes ago
Reputation
0
Spam
0.000
Last Seen
2 hours ago
Reputation
0
Spam
0.000
Last Seen
56 minutes ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
27 minutes ago
Reputation
0
Spam
0.000
Last Seen
2 hours ago
Reputation
0
Spam
0.000
Last Seen
52 minutes ago
Reputation
0
Spam
0.000
Last Seen
5 minutes ago
Reputation
0
Spam
0.000
Last Seen
about an hour ago
Reputation
0
Spam
0.000
Last Seen
27 minutes ago
Reputation
0
Spam
0.000
Last Seen
20 minutes ago
Reputation
0
Spam
0.000
Last Seen
9 months ago
Reputation
0
Spam
0.000