Here you can find the source of capitalize(String token)
public static String capitalize(String token)
//package com.java2s; //License from project: Open Source License public class Main { public static String capitalize(String token) { if (token.length() == 0) return ""; char cap = Character.toUpperCase(token.charAt(0)); if (token.length() == 1) return Character.toString(cap); return cap + token.substring(1); }//from www . ja v a2 s.c om }