我有以下字符串:轉換數組中的字符串格式到一個數組
"[[0, 0, 0], [1, 1, 1], [2, 2, 2]]"
什麼是Java中最簡單的方法將其轉換爲一個純粹的多維float數組? 財產以後像這樣的例子:
String stringArray = "[[0, 0, 0], [1, 1, 1], [2, 2, 2]]";
float[][] floatArray = stringArray.parseSomeHow() //here I don't know the best way to convert
當然,我可以寫一個算法,將例如讀取每個字符左右。但是也許有一種java已經提供的更簡單快捷的方式。
請仔細閱讀[我如何問一個好問題?](http:/ /stackoverflow.com/help/how-to-ask),然後再嘗試提出更多問題。 –
在嘗試提出更多問題之前,請閱讀[應避免詢問什麼類型的問題?](http://stackoverflow.com/help/dont-ask)。 –
爲什麼不在實際的字符串數組中傳遞「stringArray」? – XtremeBaumer