Title Case a Sentence
- Lingua principale
- HTML
- Stelle
- 65
- Fork
- 15
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hello,
So I'm beginning to understand things a little bit more! :sparkles:
This one is beginning to annoy me though. It's just returning "I'm a little tea pot" which is about as annoying as when you order a pot of tea and it has just one cup's worth in it. :tea:
Thanks in advance!
**QUESTION**
Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.
For the purpose of this exercise, you should also capitalize connecting words like "the" and "of".
Remember to use Read-Search-Ask if you get stuck. Write your own code.
**MY CODE**
```
function toUpperCase(str) {
str = str.toLowerCase().split(" ");
for (var i = 0; i < str.length; i++) {
str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);
return str.join (" ");
}
}
titleCase("I'm a little tea pot");
```
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.