Answers for "count white spaces in JS"

2

replace white spaces javascript

const name = 'Hi my name is Flavio'
name.replace(/\s/g, '') //HimynameisFlavio
Posted by: Guest on April-27-2020
3

check whitespace in javascript

if (/\s/.test(str)) {
    // It has any kind of whitespace
}
Posted by: Guest on August-04-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language