Here you can find the source of toProperCase(String text)
public static String toProperCase(String text)
//package com.java2s; //License from project: Open Source License public class Main { public static String toProperCase(String text) { text = text.toLowerCase();/*from w w w. ja v a2 s . co m*/ if (text.length() > 1) { text = text.substring(0, 1).toUpperCase() + text.substring(1).toLowerCase(); } else { text = text.toUpperCase(); } return text; } }