Possible Duplicate:
Is there a method that will evaluate a string and produce an integer (assuming the string is an equation) in C#
Hi all, i just wonder how to make a realtime complination in C# For example: i have a string like this
string math = "1 + 2 + (4 - 6)";
And i want to complie it to get the result How to do that? and is that the bad idea because i want to make a calculator in C#?
Edited: The main question properly is that i want to do it in WP7, not exactly in C# windows lol, i tried all the solutions below but not at all is correct!