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
For replacing variables by values ("X" by "4", for example), you can use the simple "Replace" string function.
But your problem gets more complicated when you want for the computer to calculate the string.... Actually, I don't think it's possible without having to write your own interpreter (that means major SELECT CASE statement, not to mention parenteses processs....wow!)
Maybe you should look into SQL; I know it is not database related, but it seems SQL has some math functions (at least I think...). Since SQL "reads" string values, that might do what you want...
I've attached some SQL Tutorials (I haven't read them myself yet...)