I have a string that contains some mathematical formula which I want to execute dynamically and I want to store that value in a string. E.g.
String formula = "10 * 9";
... (execute somehow)
String result = "90"; (after successful execution).
I am using openjdk-18, therefore I cannot use ScriptEngine.
Is there any other way to do it?
Edit: possible operations: +, -, *, /, %, ^, brackets support
e.g. "((12/4) * (3 - 1) ^3)"