Here you can find the source of toUpperCaseFirstChar(String str)
public static String toUpperCaseFirstChar(String str)
//package com.java2s; public class Main { public static String toUpperCaseFirstChar(String str) { if (str == null || str.length() == 0) { return null; }//from w w w.j av a 2s . com if (Character.isUpperCase(str.charAt(0))) { return str; } else { return (new StringBuilder()).append(Character.toUpperCase(str.charAt(0))).append(str.substring(1)) .toString(); } } }