I need help with this method. The program runs but i still hava problem for example i enter +56 and return 11 but when i tried to enter -+567 return 25 instead of 23 also when i tried to enter +45-3 it return 9 so after 5 the program stop it just return the addition of 4+5
public static int prefixEvaluation(String s){
int result=0 ;
int i=1;
char ch = s.charAt(0);
s=s.substring(i , s.length());// I want to be able to read all the character of the string every time i call the recursive method
if (ch>='0'&& ch<='9'){
result=((int)ch-48);
System.out.println(result);
return result;
}
else if (ch=='+'|| ch=='-'|| ch=='*'|| ch=='/'){
char op=ch;
System.out.println(ch);
int operand1= prefixEvaluation(s);
s = s.substring(i++);
int operand2= prefixEvaluation(s);