I have a TextBox where I enter a math formula, such as X^2-3*X+2. I can save that to a string variable, then manipulate it as I need to. However, I eventually need to evaluate the mathematical result of the string. For example, if in my program, I chose X to equal 4, then I would want the string formula to somehow be evaluated to equal 6. How do I convert a string representation of a formula into the numerical result of the imbedded computation?

I want that it calculates with what is in TextBox - variables

Thank you