Evaluate mathematical expression from a string using VB

Solution 1:

Dim equation As String = "2+6/2"
Dim result = New DataTable().Compute(equation, Nothing)

Solution 2:

you can use NCalc for this. It also accepts parameters like x, y, z,...

Dim e As Expression = new Expression("2 + 3 * 5")
Msgbox(17 = e.Evaluate())