Click here to Skip to main content
15,891,033 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I know how to design a simple calculate in c#.net with forms but I don't know how could I design it in order to get a string like this: 12-(3*2)+14
and calculate it? I don't know how to manage the priority of operands...
Posted

1 solution

you can use DataTable.Compute method

var result = new DataTable().Compute("12-(3*2)+14", null);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900