java - convert an arraylist to two dimentional array and also change format a bit -
i have arraylist containing many records like
"2013-7-13 \n 12 hour(s) 23 minute(s)" "2013-7-14 \n 4 hour(s) 19 minute(s).
how can covert 2 dimentional array, string[][],
making looks
{"2013-7-13", "12h23m"}, {"2013-7-14", "4h19m"}.
i need 2 dimentional array can draw barchart in xy , display in android device. x represents date, while y represent time.
you can use string.split split each string parts.
// untested, not compilation errors string[][] twodimarray = new string[oldarr.length][]; (int = 0, n = oldarr.length; < n; i++) { string splitme = oldarr[i]; twodimarray[i] = splitme.split("\n"); }
Comments
Post a Comment