Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript check if string ends with space

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

    }
 
PREVIOUS NEXT
Tagged: #javascript #check #string #ends #space
ADD COMMENT
Topic
Name
6+8 =