MystX Jones

MystX Jones

  • NA
  • 6
  • 0

Adding two numbers in the same string

Sep 4 2008 8:58 PM

Hi there

I had this typed out and clicked "post" and all i got was a cleared post screen, so forgive me if i forget something

Basically i need an answer to a string similar to "2+3" or "9+6/3"

The only way i can see to do this in to seperate the two terms and operation, and then "if (Operation == "+") FirstInt + SecondInt" and so on.

Is there a way to make C# run what is contained in the string as a sort of command?

Thanks in advance.


Answers (3)