I'm having a Json file like this {"Name":"Saaa","AppIcon":"ddd.jpg","Wallpaper.jpg","ddd.jpg"]}
. I need to extract the AppIcon
values.I'm using json simple
lib to parse the json
.The code snippet to parse the values is as below.
FileReader appIconReader = new FileReader("jsonpath.json");
JSONObject jsonIconObject = (JSONObject)jsonParser.parse(appIconReader);
System.out.println("APPLICATION ICON = "+jsonIconObject.get("AppIcon"));
But the output what I'm gettin is a single string as below:
["ddd.jpg","Wallpaper.jpg","ddd.jpg"]
I need to extract the individual values like this
- ddd.jpg
- Wallpaper.jpg
- ddd.jpg
Not with the square brackets([]) and double quotes("") as I'm getting right now.How can I do that?
See Question&Answers more detail:os