Answers for "javascript check if string ends with space"

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 "javascript check if string ends with space"

Code answers related to "Javascript"

Browse Popular Code Answers by Language