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("\\+");
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("\\+");