Java String Capitalize First capitalizeFirstLeter(String sentence)

Here you can find the source of capitalizeFirstLeter(String sentence)

Description

Capitalize first letter.

License

Open Source License

Parameter

Parameter Description
sentence the sentence

Return

the string

Declaration

public static String capitalizeFirstLeter(String sentence) 

Method Source Code

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

public class Main {
    /**/*from  w ww .  j  av  a2 s . co  m*/
      * Capitalize first letter. This should work for UTF-8 special chars also
      * unlike the ASCII code test.
      *
      * @param sentence
      *            the sentence
      * @return the string
      */
    public static String capitalizeFirstLeter(String sentence) {
        return sentence.substring(0, 1).toUpperCase() + sentence.substring(1);
    }
}

Related

  1. CapitalizeFirstCharacter(String Str)
  2. capitalizeFirstCharacter(String value)
  3. capitalizeFirstCharacters(String whole)
  4. capitalizeFirstCharacterString(String item)
  5. capitalizeFirstCharOfString(final String input)
  6. capitalizeFirstLetter(final CharSequence chars)
  7. capitalizeFirstLetter(final String aString)
  8. capitalizeFirstLetter(final String s)
  9. capitalizeFirstLetter(final String variableName)