I have a String like this.
{"type":"broad","Text":"cat"},{"type":"broad","Text":"dog"}
String[] keyString = getParts({"type":"broad","Text":"cat"},{"type":"broad","Text":"dog"});
for(String part : keyString){
some code here which gives like this
String text = "cat";
String type = "broad";
}
Can some one tell me how can i get text and type separately in a string
public static String[] getParts(String keyString) {
if(keyString.isEmpty())
return null;
String[] parts = keyString.split(",");
return parts;
}
Or is there any easy ways to get the respective strings.