Here you can find the source of capitalizeFully(String to_capitalize)
public static String capitalizeFully(String to_capitalize)
//package com.java2s; //License from project: Open Source License public class Main { public static String capitalizeFully(String to_capitalize) { if (to_capitalize == null || to_capitalize.equals("")) return to_capitalize; else if (to_capitalize.length() == 1) return to_capitalize.toUpperCase(); else/*from w w w . j a v a 2 s . c o m*/ return to_capitalize.substring(0, 1).toUpperCase() + to_capitalize.substring(1).toLowerCase(); } public static String substring(String string, String beginning, String end) { if (!string.contains(beginning) || !string.contains(end) || string.indexOf(beginning) >= string.indexOf(end)) return null; else { String after_beginning = string.substring(string.indexOf(beginning) + beginning.length()); return after_beginning.substring(0, after_beginning.indexOf(end)); } } }