Convert string operation symbols "+", "-", "/", "*" etc.
What is the easiest way to convert a string expression to something I can solve? I have never used association lists but could that work? Or maybe the replaceAll() function?
For clarification I'm trying to solve functions such as "3 + 4", or [ "3", "+", "4"].
Re: Convert string operation symbols "+", "-", "/", "*" etc.
I once wrote a blog article for this forum: the article develops a compiler for infix expressions and shows you a way how to parse and interpret/evaluate those expressions. The blog article contains all the code. If I'm not mistaken there's a link to my blobs on the right side of this reply.
kind regards,
Jos
Re: Convert string operation symbols "+", "-", "/", "*" etc.
Quote:
Originally Posted by
JosAH
If I'm not mistaken there's a link to my blobs on the right side of this reply.
Surely "blogs"?
I'm not sure showing off your blobs on a public forum is entirely legal...
Re: Convert string operation symbols "+", "-", "/", "*" etc.
Quote:
Originally Posted by
Tolls
Surely "blogs"?
I'm not sure showing off your blobs on a public forum is entirely legal...
What's wrong with my blobs? The'yre fine blobs and fully functional; and don't you stare at my blobs!
kind regards,
Jos ;-)