String To Expression
-
Hi Guys and Gals. I have a simple question, but for the life of me cant find an answer out there. I have a string that will contain an Expression: string x = "(2+3)+((7*2)-5)"; I need x to execute now as an expression in order to get the result of the expression. Eg. decimal y = (2+3)+((7*2)-5); [This is the value from the text string x] Result in y = 14 Your help will be greatly appreciated or your guidance to a possible workable solution. Kind Regards, Elizma
-
Hi Guys and Gals. I have a simple question, but for the life of me cant find an answer out there. I have a string that will contain an Expression: string x = "(2+3)+((7*2)-5)"; I need x to execute now as an expression in order to get the result of the expression. Eg. decimal y = (2+3)+((7*2)-5); [This is the value from the text string x] Result in y = 14 Your help will be greatly appreciated or your guidance to a possible workable solution. Kind Regards, Elizma
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
-
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
Thanx for your help! I tried searching for it before I asked the question, but I guess my search criteria was wrong since the I put in "Convert String To Expression". I found something that works. E.g. string x = "(2+3)+((7*2)-5)"; DataTable dt = new DataTable(); object sumObject; sumObject = dt.Compute(x, ""); Elizma
-
Hi Guys and Gals. I have a simple question, but for the life of me cant find an answer out there. I have a string that will contain an Expression: string x = "(2+3)+((7*2)-5)"; I need x to execute now as an expression in order to get the result of the expression. Eg. decimal y = (2+3)+((7*2)-5); [This is the value from the text string x] Result in y = 14 Your help will be greatly appreciated or your guidance to a possible workable solution. Kind Regards, Elizma
-
Hi Guys and Gals. I have a simple question, but for the life of me cant find an answer out there. I have a string that will contain an Expression: string x = "(2+3)+((7*2)-5)"; I need x to execute now as an expression in order to get the result of the expression. Eg. decimal y = (2+3)+((7*2)-5); [This is the value from the text string x] Result in y = 14 Your help will be greatly appreciated or your guidance to a possible workable solution. Kind Regards, Elizma
Reverse Polish Notation[^] and something to make use of it[^]. Or even CodeDom[^].