Here you can find the source of capitalize(String str)
public static String capitalize(String str)
//package com.java2s; //License from project: Open Source License public class Main { public static String capitalize(String str) { if (str == null || str.equals("")) return str; return str.substring(0, 1).toUpperCase() + str.substring(1); }/*from w w w . j ava 2 s . c o m*/ public static boolean equals(String str1, String str2) { if (str1 == null && str2 == null) return true; if (str1 == null || str2 == null) return false; return str1.equals(str2); } }