Here you can find the source of toUpperCaseAtFirstChar(String string)
public static String toUpperCaseAtFirstChar(String string)
//package com.java2s; /**/* w ww . j a v a 2 s.c o m*/ * Copyright (c) 2015 SK holdings Co., Ltd. All rights reserved. * This software is the confidential and proprietary information of SK holdings. * You shall not disclose such confidential information and shall use it only in * accordance with the terms of the license agreement you entered into with SK holdings. * (http://www.eclipse.org/legal/epl-v10.html) */ public class Main { public static String toUpperCaseAtFirstChar(String string) { if (isEmpty(string)) { return ""; } StringBuffer buffer = new StringBuffer(); buffer.append(string.substring(0, 1).toUpperCase()); buffer.append(string.substring(1, string.length())); return buffer.toString(); } public static boolean isEmpty(String string) { return string == null || string.equals("") ? true : false; } }