There is no function provided by default, but you can do the following by using Streams (if your String has exactly that format you specified):
String[][] a =
Arrays.stream(s.substring(2, s.length()-2).split("\\],\\["))
.map(sub -> sub.split(","))
.toArray(String[][]::new);
Here, you cut off the first and last two brackets (.substring(2, s.length()-2)
), then split your String (.split("\\],\\[")
)(which results in an array of Strings of format "asdf,fdsa".
Array.stream
creates a stream of that, map
splits those Strings to arrays, and then you can collect them with the toArray
-method.
Printing this array of arrays leads to:
1509321600000 35166.44
1509408000000 35224.31
1509580800000 35234.60