Solución

@jessusthread_d654f577·hace 3dTypeScript
solution.tsTypeScript
public class Solution {
    public String capitalizeWords(String text) {

        String[] words = text.split(" ");
        String finalText = "";

        for (String word : words) {
            String firstLetter = word.substring(0, 1);
            String replaceFirstLetter = word.replace(firstLetter, firstLetter.toUpperCase());

            finalText += " " + replaceFirstLetter;
        }

        return finalText.trim();
    }
}
0respuestas
Respuestas

Aún no hay respuestas

¡Sé el primero en responder!

Escribir un comentario

Recuerda ser amable. Estás comentando la solución de otra persona. Comparte tu perspectiva de forma constructiva y respetuosa.

Debes iniciar sesión para publicar un comentario.