Here you can find the source of capitalizeFirstCharacter(String value)
Parameter | Description |
---|---|
value | String |
public static String capitalizeFirstCharacter(String value)
//package com.java2s; public class Main { /**/* ww w. jav a 2 s . c om*/ * Method capitalizeFirstCharacter * * @param value String * @return String */ public static String capitalizeFirstCharacter(String value) { if (isNullOrEmpty(value)) { return value; } char[] chars = value.toCharArray(); chars[0] = Character.toUpperCase(chars[0]); return new String(chars); } /** * Method isNullOrEmpty * * @param value String * @return boolean */ public static boolean isNullOrEmpty(String value) { return (value == null) || (value.length() == 0); } }