Here you can find the source of getStringArray(String str)
public static String[] getStringArray(String str)
//package com.java2s; import java.util.List; public class Main { public static String[] getStringArray(String str) { String[] strarr = new String[1]; strarr[0] = str;//from w ww. ja v a2s. c o m return strarr; } public static String[] getStringArray(List list) { String[] strarr = new String[list.size()]; if (list != null && list.size() > 0) { for (int i = 0; i < list.size(); i++) { strarr[i] = (String) list.get(i); } } return strarr; } }