Here you can find the source of splitOnUppercase(String input)
public static final String[] splitOnUppercase(String input)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static final String[] splitOnUppercase(String input) { StringBuilder part = new StringBuilder(); List<String> parts = new ArrayList<String>(); for (char c : input.toCharArray()) { if (Character.isUpperCase(c)) { if (part.length() > 0) parts.add(part.toString()); part.setLength(0);/*from ww w .ja v a2s. c om*/ } part.append(c); } if (part.length() > 0) parts.add(part.toString()); return parts.toArray(new String[parts.size()]); } }