Here you can find the source of capitalize(StringBuilder text)
public static void capitalize(StringBuilder text)
//package com.java2s; /*// w ww . j a va 2s . com * This file is part of SimpleClans2 (2012). * * SimpleClans2 is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * SimpleClans2 is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with SimpleClans2. If not, see <http://www.gnu.org/licenses/>. * * Last modified: 10.10.12 21:57 */ public class Main { public static void capitalize(StringBuilder text) { if (text.length() == 0) { return; } text.setCharAt(0, Character.toUpperCase(text.charAt(0))); } public static String capitalize(String text) { StringBuilder builder = new StringBuilder(text); capitalize(builder); return builder.toString(); } }