更新时间:2023-02-21 12:43:24
确实如此。但是 split(...)
返回一个数组,它不会将 String
转换为字符串[]
。试试这个:
It does. However split(...)
returns an array, it does not "transform" your String
into a String[]
. Try this:
String expression = "1+2+10+1";
String[] tokens = expression.split("\\+");