int multiplyIndex = str.indexOf("x");
int divideIndex = str.indexOf("÷");
int firstOperationIndex = -1;
if (multiplyIndex == -1) firstOperationIndex = divideIndex;
if (divideIndex == -1) firstOperationIndex = multiplyIndex;
if (firstOperationIndex == -1) firstOperationIndex = Math.min(multiplyIndex, divideIndex);
String operation = str.substring(firstOperationIndex, firstOperationIndex+1);
String leftE = str.substring(0, firstOperationIndex-1);
String rightE = str.substring(firstOperationIndex+2);
其中,str是例如“1+2+3x4+7”之类的字符串
习惯受伤