Solución
solution.tsTypeScript
public class Solution {
public String capitalizeWords(String text) {
String[] words = text.split(" ");
for (int i = 0; i < words.length; i++) {
char firstLetter = Character.toUpperCase(words[i].charAt(0));
String rest = words[i].substring(1);
words[i] = firstLetter + rest;
}
return String.join(" ", words);
}
}0respuestas