Evaluating string “3*(4+2)” yield int 18 [duplicate]

If you want to evaluate a string expression use the below code snippet.

using System.Data;

DataTable dt = new DataTable();
var v = dt.Compute("3 * (2+4)","");

Leave a Comment