Here you can find the source of split(String s)
public static String[] split(String s)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static String[] split(String s) { List<String> result = new ArrayList<>(); int counter = 0; while (counter <= s.length()) { int pos = s.indexOf(",", counter); if (pos == -1) { pos = s.length();//from w w w. j a v a 2 s .co m } String fragment = s.substring(counter, pos); result.add(fragment.substring(1, fragment.length() - 1)); counter += fragment.length() + 1; } return result.toArray(new String[result.size()]); } }