Here you can find the source of capitalize(String src)
public static String capitalize(String src)
//package com.java2s; public class Main { public static String capitalize(String src) { StringBuffer buffer = new StringBuffer(src.length()); char c = src.charAt(0); buffer.append(Character.toTitleCase(c)); for (int i = 1; i < src.length(); i++) { buffer.append(src.charAt(i)); }/*from ww w . j a v a 2 s . com*/ return buffer.toString(); } }