Here you can find the source of capitalizedCase(CharSequence source, char... delimiters)
public static String capitalizedCase(CharSequence source, char... delimiters)
//package com.java2s; import static java.lang.Character.*; public class Main { public static String capitalizedCase(CharSequence source) { return capitalizedCase(source, null); }/*www .ja v a 2 s . c o m*/ public static String capitalizedCase(CharSequence source, char... delimiters) { int delimitersCount = delimiters == null ? -1 : delimiters.length; if (isEmpty(source) || delimitersCount == 0) { return source.toString(); } char[] buffer = source.toString().toLowerCase().toCharArray(); boolean capitalizeNext = true; for (int i = 0; i < buffer.length; i++) { char ch = buffer[i]; if (isDelimiter(ch, delimiters)) { capitalizeNext = true; } else if (capitalizeNext) { buffer[i] = toTitleCase(ch); capitalizeNext = false; } } return new String(buffer); } public static boolean isEmpty(CharSequence source) { return source == null || source.length() == 0; } public static boolean isDelimiter(char ch, char[] delimiters) { if (delimiters == null) { return Character.isWhitespace(ch); } for (char delimiter : delimiters) { if (ch == delimiter) { return true; } } return false; } }