Tag Archives: String in JavaScript

How to remove leading and trailing spaces from a string in JavaScript.

JavaScript
Some browsers gives an error when you use the function like trim() with string in JavaScript as ‘unknown function or property’. For it we can use a regular expression that will replace all extra spaces at the start and end of the string with an empty string. Continue reading How to remove leading and trailing spaces from a string in JavaScript.