Here you can find the source of capitalize(String value)
public static String capitalize(String value)
//package com.java2s; /**//w w w.j ava 2s .c o m * Sencha GXT 3.0.1 - Sencha for GWT * Copyright(c) 2007-2012, Sencha, Inc. * licensing@sencha.com * * http://www.sencha.com/products/gxt/license/ */ public class Main { public static String capitalize(String value) { int length = value.length(); StringBuilder s = new StringBuilder(length); for (int i = 0; i < length; i++) { char c = value.charAt(i); if (i == 0) { c = Character.toUpperCase(c); } else { c = Character.toLowerCase(c); } s.append(c); } return s.toString(); } }