remove space before and after text in javascript code example
Example 1: js remove space before string
var str = " Some text ";
str.trim();
// str = "Some text"
Example 2: javascript trim spaces
value = value.trim();
var str = " Some text ";
str.trim();
// str = "Some text"
value = value.trim();