Here you can find the source of arrayFromString(String s)
public static String[] arrayFromString(String s)
//package com.java2s; // are made available under the terms of the Eclipse Public License v1.0 public class Main { public static String[] arrayFromString(String s) { if (s == null) return new String[] {}; if (!s.startsWith("[") || !s.endsWith("]")) throw new IllegalArgumentException(); if (s.length() == 2) return new String[] {}; return s.substring(1, s.length() - 1).split(" *, *"); }//from w w w . ja va 2 s. com }