List转换String[]或String

List<String> strlist = new ArrayList<String>();
strlist.add("sdfs1");
strlist.add("sdfs2");


转换为String[]
String[] resultList = new String[] {};

resultList = strlist.toArray(new String[0]);
// or
resultList = strlist.toArray(new String[resultList.size()]);


转换为String
String result = "";

result = Arrays.toString(resultList)

你可能感兴趣的:(String,array,list,convert)