You can use:
Character.isDigit(someChar)
This will tell you if a char is a number or not.
If it is not, you can assume it is an operator and treat it as such.
So an implementation could look like:
CharSequence chars = "1+2-3";
for(int i = 0; i < chars.length(); i++ ) {
if (Character.isDigit(chars.charAt(i))) {
//is digit
} else {
//is operator
}
}
*I don't have a java compiler available, so I cant promise that works at the moment.