I am trying to get something like this to work
String s="3+33";
int i = Integer.parseInt(s);
String s2= Integer.toString(i);
System.out.println(s2);
However, it gives me NumberFormatException. Is there any workaround for this?
I am trying to get something like this to work
String s="3+33";
int i = Integer.parseInt(s);
String s2= Integer.toString(i);
System.out.println(s2);
However, it gives me NumberFormatException. Is there any workaround for this?
There are a method in python, eval(), which can get the result of a string. For java you can use ScriptEngineManager for this purpose.
Please read this answer, it will help you a lot.