trim jquery code example
Example 1: trim space in jquery
var str = " Hello World! ";
alert(str.trim());
Example 2: javascript whitespace strip
yourvariable.trim()
Example 3: 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"