Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to make last letter of string uppercase in javascript

function endCaseWords(input) {
    return input.toLowerCase().split(" ").map(function(item) {
        return item.slice(0, -1) + item.slice(-1).toUpperCase();
    }).join(" ");
}

document.write(endCaseWords("Party like its 2015"));
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #letter #string #uppercase #javascript
ADD COMMENT
Topic
Name
2+6 =