string expr = "1+2"; int a = eval(expr); // Evaluate the string as an expression print(a);