js space in string code example
Example 1: js find space in string
if(str.indexOf(' ') >= 0){
console.log("contains spaces");
}
Example 2: // How to create string with multiple spaces in JavaScript var a = 'something' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + 'something';
var a = 'something' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + 'something';