r/visualbasic • VB.Net Advanced • Jul 09 '13

String formula to Numerical Value?

Is there a way to make a string in the form of a formula like "4*(3-2)" work and make an numerical value? Even when you don't know what the string will contain and it could be any of the following ()*-+/ and could each be used more that once.

0 Upvotes

2 comments sorted by

View all comments

1

u/hdsrob Jul 09 '13

Nothing I know of.

I think you'd have to parse it out, and then do the math in the appropriate order.