javascript space in string code example
Example 1: javascript trim spaces
value = value.trim();
Example 2: js find space in string
if(str.indexOf(' ') >= 0){
console.log("contains spaces");
}
value = value.trim();
if(str.indexOf(' ') >= 0){
console.log("contains spaces");
}