NB: This answer is just for completeness. It's definitely not an approach that I'd recommend.
It's possible to access the (deprecated) JScript libraries directly from C#, which means that you can use the equivalent of JScript's eval
function.
using Microsoft.JScript; // needs a reference to Microsoft.JScript.dll
using Microsoft.JScript.Vsa; // needs a reference to Microsoft.Vsa.dll
// ...
string expr = "2 - 3 / 4 * 12";
Console.WriteLine(JScriptEval(expr)); // displays -7
// ...
public static VsaEngine _engine = VsaEngine.CreateEngine();
public static double JScriptEval(string expr)
{
// error checking etc removed for brevity
return double.Parse(Eval.JScriptEvaluate(expr, _engine).ToString());
}