Java String轉List

1.String數組轉List

	public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException {
  		String str= "[{\"YHDM\":\"xs126032\",\"ZSXH\":null,\"XM\":\"小飛俠\"}]";
		ObjectMapper mapper = new ObjectMapper();
  		List<Map<String,String>> conList = mapper.readValue(str, List.class);
  		System.out.println(conList.size());
	}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章