public static String[] mapToStrings(Map<String, String[]> mapList) {
String[] res = new String[0];
for (String[] s : mapList.values()) {
int a = res.length;
int b = s.length;
res= Arrays.copyOf(res,a + b);//扩容
System.arraycopy(s, 0, res, a,b);//将第二个数组与第一个数组合并
}
return res;
}
将Map<String, String[]>转换成String[]
最新推荐文章于 2022-05-16 17:13:02 发布