Here you can find the source of camelCaseToPhrase(String camelCase)
public static String camelCaseToPhrase(String camelCase)
//package com.java2s; public class Main { public static String camelCaseToPhrase(String camelCase) { if (isEmpty(camelCase)) { return ""; }// ww w . j a v a2 s . co m String camelCaseSpaced = camelCase.replaceAll("([^A-Z])([A-Z])", "$1 $2"); return camelCaseSpaced.charAt(0) + camelCaseSpaced.substring(1).toLowerCase(); } public static boolean isEmpty(String string) { return string == null || string.isEmpty(); } }