Here you can find the source of toUpperCaseFirst(String text)
Parameter | Description |
---|---|
text | the text which should be capitalized. |
public static String toUpperCaseFirst(String text)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . jav a 2 s. c o m*/ * Changes the first character of the given text to upper case. * * @param text the text which should be capitalized. * @return the capitalized text. */ public static String toUpperCaseFirst(String text) { char[] charArray = text.toCharArray(); charArray[0] = Character.toUpperCase(charArray[0]); return String.valueOf(charArray); } }