jquery trim spaces code example
Example 1: trim space in jquery
var str = " Hello World! ";
alert(str.trim());
Example 2: javascript remove first space in string
//use trim() on your string. It removes first and last whitepsaces
let str = " aa bb ";
console.log(str.trim()); // "aa bb"