首页 > 其他分享 >数组字符串转数组

数组字符串转数组

时间:2023-01-06 11:57:51浏览次数:56  
标签:数组 262699 262698 str 字符串 String

数组字符串转数组 String str = "[262698, 262699, 262701]"; Integer[] integers = JSON.parseObject(str, Integer[].class);   //二维数组字符串转二维数组 String str = "[[262698, 262699, 262701], [262698, 262699, 262889], [262698, 262699, 263058]]"; Integer[][] cityIds = JSON.parseObject(str, Integer[][].class);   //数组字符串转LIST String str = "[262698, 262699, 262701]"; List<Integer> integers = JSON.parseObject(str, new TypeReference<List<Integer>>() {});   //二维数组字符串转LIST String str = "[[262698, 262699, 262701], [262698, 262699, 262889], [262698, 262699, 263058]]"; List<List<Integer>> integers = JSON.parseObject(str, new TypeReference<List<List<Integer>>>() {});

标签:数组,262699,262698,str,字符串,String
From: https://www.cnblogs.com/chenfuming/p/17030018.html

相关文章