Hello I'm trying to convert an Array which has been sent from my JavaScript after going through the JSON.stringify
method. I'm currently experimenting/looking at a regex solution for it but anything that returns a normal JAVA Array<Integer>
with the values between the "" works.
JAVA Code:
private ArrayList<Integer> convertJSONArrayStringtoArray(String jsonArrayString){
Matcher m = Pattern.compile(".*\\\"(.*)\\\".*").matcher(jsonArrayString);
while(m.find()) {
System.out.println("convertJSONtoArray: " + m.group(1));
}
return null;
}
String Composition (Note that the string is not a JSON object that holds a array, just a simple array):
["12441","3324","11584","3337","25739","25810"]