Java String Capitalize First capitalizeFirstCharacters(String whole)

Here you can find the source of capitalizeFirstCharacters(String whole)

Description

capitalize First Characters

License

Open Source License

Declaration

public static String capitalizeFirstCharacters(String whole) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static String capitalizeFirstCharacters(String whole) {
        final StringBuilder result = new StringBuilder(whole.length());
        String[] words = whole.split("\\s");
        for (int i = 0, l = words.length; i < l; ++i) {
            if (i > 0)
                result.append(" ");
            result.append(Character.toUpperCase(words[i].charAt(0))).append(words[i].substring(1));

        }// w w  w.j  a v  a 2s.  c  o m
        return result.toString();
    }
}

Related

  1. capitalizeFirstCharacter(String s)
  2. capitalizeFirstCharacter(String str)
  3. capitalizeFirstCharacter(String str)
  4. CapitalizeFirstCharacter(String Str)
  5. capitalizeFirstCharacter(String value)
  6. capitalizeFirstCharacterString(String item)
  7. capitalizeFirstCharOfString(final String input)
  8. capitalizeFirstLeter(String sentence)
  9. capitalizeFirstLetter(final CharSequence chars)