Here you can find the source of capitalize(String str)
private static String capitalize(String str)
//package com.java2s; //License from project: Apache License public class Main { private static String capitalize(String str) { String prefix = str.substring(0, 1).toUpperCase(); String suffix = str.length() > 1 ? str.substring(1).toLowerCase() : ""; return prefix + suffix; }/*from w ww . j a v a 2 s .c om*/ }