Java tutorial
//package com.java2s; import java.util.ArrayList; import android.text.TextUtils; public class Main { @SuppressWarnings("nls") public static String[] getStringIdArray(String serializedTree) { ArrayList<String> ids = new ArrayList<String>(); String[] values = serializedTree.split("[\\[\\],\"\\s]"); // Split on [ ] , or whitespace chars for (String idString : values) { if (!TextUtils.isEmpty(idString)) ids.add(idString); } return ids.toArray(new String[ids.size()]); } }