Just for fun, I've decided to make a simple calculator as an exercize. And this got me to wondering the following. In making a calculator, one needs two strings to hold the input, then convert these strings to integers (I'm making a very simple calculator). But is there a way to take a number-style string containing a sign for an arithmetical operation, say, "+", and evaluate the whole thing? E.g., can one construct a mathematical function expression from "7+5"? I've perused the libraries, to no avail, but the libraries are, well, big, so maybe I've missed something. If not, I guess I'll just have to find out which operator button has been pushed and use the appropriate operation. But it would be nice to do something like the above.
I'm not aware of anything in the standard libraries that do what you want. Making a calculator can be challenging and educational. Do some research on Reverse Polish Notation, infix and postfix notation, and stacks. Good luck. Junilu