Remova espaços em uma corda JS
str.replace(/\s+/g, '')
Dangerous Duck
str.replace(/\s+/g, '')
str = str.replace(/\s/g, '');
const sentence = ' My string with a lot of Whitespace. '.replace(/\s+/g, ' ').trim()
// 'My string with a lot of Whitespace.'