Java String Capitalize First capitalizeFirstCharacter(String str)

Here you can find the source of capitalizeFirstCharacter(String str)

Description

Utility method to capitalize first character in the String

License

BSD License

Declaration

static String capitalizeFirstCharacter(String str) 

Method Source Code

//package com.java2s;
/*L/*from   w ww.ja v  a 2 s  .  c  o m*/
 * Copyright Georgetown University, Washington University.
 *
 * Distributed under the OSI-approved BSD 3-Clause License.
 * See http://ncip.github.com/cab2b/LICENSE.txt for details.
 */

public class Main {
    /**
     * Utility method to capitalize first character in the String
     */
    static String capitalizeFirstCharacter(String str) {
        char[] chars = str.toCharArray();
        char firstChar = chars[0];
        chars[0] = Character.toUpperCase(firstChar);
        return new String(chars);
    }
}

Related

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