Android examples for java.lang:String Case
capitalize the first letter in string
import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static String capitalize(final String word) { if (word.length() > 1) { return String.valueOf(word.charAt(0)).toUpperCase() + word.substring(1); }//from w w w .java2 s .co m return word; } }