Here you can find the source of capitalize(String input)
public static String capitalize(String input)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { /**//w w w . j a v a2 s . co m * Capitalizes a string, converting the first character to uppercase. */ public static String capitalize(String input) { if (input.length() == 0) return input; return input.substring(0, 1).toUpperCase() + input.substring(1); } }