Java中 String[]转List<String>
Java中 String[]转List<String>

String[]转List<String>

String[] arr = new String[]{"s1","s2","s3"};
List<String> list = Arrays.asList(arr);

List<String>转String[]

List<String> list = new ArrayList<String>();
list.add("s1");
list.add("s2");
list.add("s3");
String[] arr = list.toArray(new String[list.size()]);

Last modified on 2018-11-22