Here you can find the source of splitAt(String str, char c)
public static String[] splitAt(String str, char c)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static String[] splitAt(String str, char c) { int index = str.indexOf(c); ArrayList<String> split = new ArrayList<String>(); while (index != -1) { split.add(str.substring(0, index)); str = str.substring(index + 1); index = str.indexOf(c);//w w w. java 2s.c om } //while split.add(str); String[] splitstring = split.toArray(new String[split.size()]); return splitstring; } }