Here you can find the source of capitalizeWord(String word)
word
to upper case.
Parameter | Description |
---|---|
word | the string to be transfered |
public static String capitalizeWord(String word)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w .j a v a2 s . co m*/ * Convert the initial of given string <code>word</code> to upper case. * @param word the string to be transfered * @return if given string is a valid string , then return string with * upper case initial character. */ public static String capitalizeWord(String word) { String result = null; if ((word != null) && (word.trim().length() > 0)) { result = word.substring(0, 1).toUpperCase() + word.substring(1); } else { result = word; } return result; } }