Tag Archives: capitalize

Capitalize word algorithm in Java

capit
Here is simple snippet to capitalize string:

private static String capitalize(String value) {
    return value == null ? null : 
        value.substring(0, 1).toUpperCase() + value.substring(1);
}

Simple!

Thanx to
http://stackoverflow.com/questions/5725892/how-to-capitalize-the-first-letter-of-word-in-a-string-using-java