Use Case Suggestion: Make First Letter Uppercase Of Each Word
See original GitHub issue
function toUpper(str) {
if(typeof str === "undefined"){return "";}
if(typeof str.length < 2){return "";}
return_string = decodeEntities(str)
.toLowerCase()
.split(' ')
.map(function(word) {
if(typeof word[0] === "undefined"){return "";}
return word[0].toUpperCase() + word.substr(1);
})
.join(' ');
return_string = return_string
.split('-')
.map(function(word) {
if(typeof word[0] === "undefined"){return "";}
return word[0].toUpperCase() + word.substr(1);
})
.join('-');
return return_string
}
console.log(toUpper("make words with uppercase first letter. Works-even-with-spaces"));
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Capitalize the first letter of every word - javascript
Turn to lower case, cut into individual words by splitting by whitespace, toUpperCase() on the first char of each word. – user684934. Sep...
Read more >How to Uppercase the First Letter of a Word in Python
In this article, we focus on a specific string operation in Python: how to change the letter case of the first letter in...
Read more >Capitalise first letter of each word - Power Platform Community
Use an expression to make every word lower case with the first letter still in upper case. concat(substring(item(),0,1),tolower(substring(item(),1 ...
Read more >How to Capitalize the First Letter of Each Word in JavaScript
Use the built-in method toUpperCase() on the letter you want to transform to uppercase. Capitalize the first letter of each word from a...
Read more >How do I Capitalize First Letter of Each Word of a Field?
Solved: Is there a way that I can have an end-user enter a sentence into a normal string field and that each first...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great work on the site!