I have a string in Java like this:
String s = "{{\"2D\", \"array\"}, {\"represented\", \"in a string\"}}"
How can I convert it into an actual array? Like so:
String[][] a = {{"2D", "array"}, {"represented", "in a string"}}
(What I’m looking for is a solution a bit like python’s eval())
I strongly suggest that you use a json capable library to parse your
String. However, just for fun, please take a look at the code below, that does the thing you need using onlyStringmethods: