Here you can find the source of CapitalizeFirstLetter(String name)
public static String CapitalizeFirstLetter(String name)
//package com.java2s; /********************************************************************************** * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Icons under 'icons/fugue' are made by Yusuke Kamiyamane http://www.pinvoke.com/. * Licensed under a Creative Commons Attribution 3.0 license. * <http://creativecommons.org/licenses/by/3.0/> * *********************************************************************************/ public class Main { public static String CapitalizeFirstLetter(String name) { if (name == null) return null; String firstLetter = name.substring(0, 1); String remainder = name.substring(1); String capitalized = firstLetter.toUpperCase() + remainder.toLowerCase(); return capitalized; }// www . ja va2s. c o m }