Here you can find the source of toArray(String str, String split)
public static String[] toArray(String str, String split)
//package com.java2s; //License from project: Open Source License public class Main { public static String[] toArray(String str, String split) { if (isNull(str)) { return null; }//from w w w .j ava 2 s .c om if (isNull(split)) { split = ","; } return str.split(split); } public static boolean isNull(String str) { if (str == null) return true; if ("null".equalsIgnoreCase(str)) { return true; } if ("".equals(str)) return true; return false; } public static boolean equalsIgnoreCase(String s1, String s2) { if (s1 == null) { if (s2 == null) { return true; } else { // return s2.equalsIgnoreCase(s1); return false; } } else { if (s2 == null) { return false; } else { return s1.equalsIgnoreCase(s2); } } } public static boolean equals(String s1, String s2) { if (s1 == null) { if (s2 == null) { return true; } else { // return s2.equals(s1); return false; } } else { return s1.equals(s2); } } }