Here you can find the source of capitalizeOneWord(String inputWord)
Parameter | Description |
---|---|
inputWord | The input, e.g. "aBa" |
public static String capitalizeOneWord(String inputWord)
//package com.java2s; //License from project: Open Source License public class Main { /**// ww w. j a va 2s . c o m * Capitalize one word. * * @param inputWord * The input, e.g. "aBa" * @return The outpu, e.g "Aba" */ public static String capitalizeOneWord(String inputWord) { String firstLetter = inputWord.substring(0, 1); // Get first letter String remainder = inputWord.substring(1); // Get remainder of word. return firstLetter.toUpperCase() + remainder.toLowerCase(); } }