Here you can find the source of capitalizeFirstCharacter(String s)
public static String capitalizeFirstCharacter(String s)
//package com.java2s; public class Main { public static String capitalizeFirstCharacter(String s) { if (s != null) { if (s.length() > 1) { s = Character.toUpperCase(s.charAt(0)) + s.substring(1); } else { s = s.toUpperCase();//from w w w . j a v a 2 s .c o m } } return s; } public static String substring(StringBuffer buf, int start, int lim) { int len = lim - start; char[] result = new char[len]; buf.getChars(start, lim, result, 0); return String.valueOf(result); } }