Hi All,
I have one question for you help me.
I have one string as below:
string str="7+9*6-5";
how we can calculate it?
if you know please do it and send code to me.
Thank advance!
From: Mala
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Gomathi PalaniswamyRank #714 · 3.3K reputationPosted Oct 1, 2010, 2:11 AM EDT
You can calculate like
string str = (7+9*6-5).ToString();
Manath Pathana86 reputationPosted Oct 1, 2010, 2:39 AM EDT
Mean we input string from keyboard as below:
str=7+9*6-5;
then we want to calculate it.
How can we do?
Suthish NairRank #92 · 22.8K reputationPosted Oct 1, 2010, 2:41 AM EDT
How will this work, read on the query he posted..
Manath Pathana86 reputationPosted Oct 1, 2010, 2:44 AM EDT
it is string.
but we want to calculate it.
we need to convert:
how to convert operator from string?
and how to convert string to number?
understand my question?
JureRank #2,128 · 670 reputationPosted Oct 1, 2010, 7:41 AM EDT
The string.Split method unfortunately doesn't support splitting and keeping separator strings, so I've wrote StringSplitter class few days ago, which supports various ways of splitting and extracting. Simply add Fresh.dll to your project references to use my library.