Here you can find the source of splitCamelCase(String string)
public static String[] splitCamelCase(String string)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; import java.util.List; public class Main { public static String[] splitCamelCase(String string) { List<String> nodes = new ArrayList<String>(); char[] chars = string.toCharArray(); StringBuilder buff = new StringBuilder(); for (int i = 0; i < chars.length; i++) { char c = chars[i]; if (Character.isUpperCase(c)) { nodes.add(buff.toString()); buff.delete(0, buff.length()); buff.append(Character.toLowerCase(c)); } else { buff.append(c);/*from ww w . j a va 2 s. c o m*/ } } if (buff.length() != 0) { nodes.add(buff.toString()); } return nodes.toArray(new String[nodes.size()]); } }