Java String Capitalize Word capitalizeFirstLetter(String word)

Here you can find the source of capitalizeFirstLetter(String word)

Description

capitalize First Letter

License

Open Source License

Parameter

Parameter Description
word a parameter

Declaration

public static String capitalizeFirstLetter(String word) 

Method Source Code

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

public class Main {
    /**//from   w w w  . jav a 2  s  .c  o m
     * @param word
     * @return
     */
    public static String capitalizeFirstLetter(String word) {
        if (word == null || word.isEmpty() || !Character.isLowerCase(word.charAt(0)))
            return word;
        return Character.toUpperCase(word.charAt(0)) + word.substring(1);
    }
}

Related

  1. capitalizedWords(String s)
  2. CapitalizeEachWord(String Str)
  3. capitalizeEachWord(String string)
  4. capitalizeFirstCharWords(String sentence)
  5. capitalizeFirstLetter(final String word)
  6. capitalizeFirstLetterEachWord(String sentence)
  7. capitalizeFirstLetterWord(String word)
  8. capitalizeFirsts(String word)
  9. capitalizeInitials(String words)