Here you can find the source of capitalizeFirst(String str)
Parameter | Description |
---|---|
str | a parameter |
public static String capitalizeFirst(String str)
//package com.java2s; public class Main { /**// w ww . ja v a 2 s . c om * Capitalize the first letter of the string and lowercase the rest of the * string. * * Example: * capitalizeFully("abba ooba SNOOBA") == "Abba ooba snooba" * * @param str * @return */ public static String capitalizeFirst(String str) { return str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase(); } }