Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
I am creating a calculator and I want to avoid "if/then" condition and evaluate the STRING expression just like Eval() method in Javascript.

I have also looked for Java ScriptEngine Rhino/Nashorn , but dont  know how to use them in android studio ?

Can anyone please help me out 

Thank you.


What I have tried:

I have treid MXPARSER but it looks outdated and fire runtime errors or maybe I didnt used it properly.
Posted
Updated 1-Jul-20 20:10pm

1 solution

Google is your friend: he can find things a lot faster than asking here.
A very, very quick search gave me over 300,000 hits: java string expression evaluator - Google Search[^] most of which look like they contain complete solutions...

In future, please try to do at least basic research yourself, and not waste your time or ours?
 
Share this answer
 
Comments
[no name] 2-Jul-20 7:24am    
and you also please take a moment to read my whole question. I already mentioned what I got from your baby-Google.
and dont act like you own this site.
CPallini 2-Jul-20 7:51am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900