Here you can find the source of capitalizeFirstLeter(String sentence)
Parameter | Description |
---|---|
sentence | the sentence |
public static String capitalizeFirstLeter(String sentence)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w ww . j av a2 s . co m*/ * Capitalize first letter. This should work for UTF-8 special chars also * unlike the ASCII code test. * * @param sentence * the sentence * @return the string */ public static String capitalizeFirstLeter(String sentence) { return sentence.substring(0, 1).toUpperCase() + sentence.substring(1); } }