怎么将JSON格式的串转换成String数组
你可以用正则表达式:List names = new ArrayList();List ids = new ArrayList();Pattern p = Pattern.compile("\"(.*?)\",\"(.*?)\"") ;Matcher m = p.matcher(s);while(m.find()){ names.add(m.group(1)); ids.add(m.group(2));}

怎么将JSON格式的串转换成String数组
你可以用正则表达式:List names = new ArrayList();List ids = new ArrayList();Pattern p = Pattern.compile("\"(.*?)\",\"(.*?)\"") ;Matcher m = p.matcher(s);while(m.find()){ names.add(m.group(1)); ids.add(m.group(2));}

所有评论(0)