Calculate formula which is in a String
I was wondering if it is Possible to somehow get the result of a calculation I have in a String?
For example at the end of my Code I get a String which contains
And as a result I want to get... well the result of that calculation. (In this example "9")
Now do I have to split every single character out and calculate it like this? Or is there a more efficient way?
Of course the Formula could be different every time.
Thanks for your help and time
Re: Calculate formula which is in a String
I wrote a blog once for this forum that explains and implements a simple expression compiler and interpreter; (see the link on the right side of this reply).