Okay so I am trying to make a c# chat program, you can chat with a bot (it is supposed to be a Virtual Assistant program.). I am making a calculator, but it won't work. This is my code:
reply(text.Split(' ')[1]);
int i = int.Parse(text.Split(' ')[1]);
reply(i.ToString());
reply is a void, I am using a listbox for the chat and reply adds the text to the listbox like "Bot: -string-". So reply("a") will add "Bot: a" to the listbox. Okay so this is not working, when I am writing calculate 5+5. And I am sure that text.Split(' ')[1] is 5+5.
I tried something like this:
int i = 5+5;
and it worked, I don't understand why it is not working with my code. I haven't seen a calculator made this easy, and I don't know if this is possible to do it like this. Thank you for help!