val exp = "( 0 == 1 && 10 > 11 ) || ( 10 < 9 ) && ( 10 == 10)"
val result: Boolean = evaluate(exp) //result = true/false
How can I write a simple program in Android (Kotlin) to evaluate the above string and get a boolean result? I DO NOT want to use a complete evaluator like JEL or JEval, Js Eval or any other library, as they are too large for this specific requirement.
Preconditions :
Operators supported : < > == && ||
Works only on digits
Also don't want to use ScriptEngineManager()
Note: The javax.script package is not available on Android.