I'm not sure what the "best" way is, but you could pretty easily write a
helper class in JScript.NET to to this.  JScript has the "eval" function
which makes this kind of stuff easy.

HTH,
Chris




-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of
Aaron Fanetti
Sent: Saturday, April 13, 2002 8:47 PM
To: [EMAIL PROTECTED]
Subject: [DOTNET] Evaluate math expression strings?


Does the framework have (or is someone willing to share :) ) a utility class
to do this? Or will I need to build my own interpreter? Something like...

int result = MyMath.Evaluate( "(10 / 2) * 3" );

Thanks,
Aaron

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to