Here you can find the source of split(String str, String delimeter)
public static String split(String str, String delimeter)
//package com.java2s; import java.util.ArrayList; import java.util.List; public class Main { /** @METHOD */ public static String split(String str, String delimeter) { List<String> subStrList = new ArrayList<String>(); StringBuilder buf = new StringBuilder(); for (int i = 0; i < str.length(); i++) { if (Character.isUpperCase(str.charAt(i))) { subStrList.add(buf.toString()); buf.setLength(0);//from w w w .j av a 2 s . c o m } buf.append(str.charAt(i)); } subStrList.add(buf.toString()); buf = new StringBuilder(); if (subStrList.isEmpty() == false) { for (int i = 0; i < subStrList.size(); i++) { String elem = subStrList.get(i); buf.append(elem); if (i != subStrList.size() - 1) buf.append(delimeter); } } return buf.toString(); } }