Here you can find the source of capitalizeFully(String input, String delimiters)
public static String capitalizeFully(String input, String delimiters)
//package com.java2s; //License from project: Apache License public class Main { /**//from www.jav a 2 s . c o m * This is a re-implementation of the capitalizeFully of Apache commons lang, because it appears not working * properly. * <p/> * Convert a string so that each word is made up of a titlecase character and then a series of lowercase * characters. Words are defined as token delimited by one of the character in delimiters or the begining * of the string. */ public static String capitalizeFully(String input, String delimiters) { if (input == null) { return null; } //input = input.toLowerCase(); String output = ""; boolean toUpper = true; for (int c = 0; c < input.length(); c++) { char ch = input.charAt(c); if (delimiters.indexOf(ch) != -1) { toUpper = true; output += ch; } else { if (toUpper == true) { output += Character.toUpperCase(ch); toUpper = false; } else { output += Character.toLowerCase(ch); } } } return output; } }