Loading...

Tag: trim

Trim All Whitespaces From String in JavaScript

JavaScript’s inbuilt method trim() removes whitespace from both ends of a string. The Syntax: str.trim() The method returns new string representing the str stripped of whitespace from both ends. Try yourself