I was trying to split an arithmetic expression (eg \"1+2+10+15\") on the plus signs. However, I didn\'t manage to write the appropriate regular expression. I thought this wo
It does. However split(...) returns an array, it does not "transform" your String into a String[]. Try this:
split(...)
String
String[]
String expression = "1+2+10+1"; String[] tokens = expression.split("\\+");
this way
expression.split("[+]");