Answers for "how to se if string has just space in js"

2

javascript check if blank space

function isEmptyOrSpaces(str){
    return str === null || str.match(/^ *$/) !== null;
}
Posted by: Guest on July-01-2021
0

javascript check if string ends with space

const str = "hello world ";
    const a = str.slice(-1);
    if (a == " ") {
        console.log("ends with space");

    }
Posted by: Guest on June-11-2021

Code answers related to "how to se if string has just space in js"

Code answers related to "Javascript"

Browse Popular Code Answers by Language