Java String Capitalize Word capitalizeInitials(String words)

Here you can find the source of capitalizeInitials(String words)

Description

capitalize Initials

License

Apache License

Declaration

static String capitalizeInitials(String words) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    static String capitalizeInitials(String words) {
        String[] broken = words.split(" ");
        StringBuilder result = new StringBuilder();
        for (String word : broken) {
            if (result.length() > 0) {
                result.append(" ");
            }//ww w. j a v  a  2  s  .c o m

            result.append(Character.toUpperCase(word.charAt(0))).append(word.substring(1));
        }
        return result.toString();
    }
}

Related

  1. capitalizeFirstLetter(final String word)
  2. capitalizeFirstLetter(String word)
  3. capitalizeFirstLetterEachWord(String sentence)
  4. capitalizeFirstLetterWord(String word)
  5. capitalizeFirsts(String word)
  6. capitalizeOneWord(String inputWord)
  7. capitalizeSingle(String word)
  8. capitalizeWord(String s)
  9. capitalizeWord(String s)