Here you can find the source of capitalize(final String str)
public static String capitalize(final String str)
//package com.java2s; //License from project: Apache License public class Main { public static String capitalize(final String str) { final char charAt = str.charAt(0); return Character.toUpperCase(charAt) + str.substring(1); }/*from w w w . ja va 2 s.c o m*/ public static char toUpperCase(final char ch) { // TODO optimize return Character.toUpperCase(ch); } }