Well, idk how advanced with this your getting. If you're talking about
:
15 + 12
That easy to parse(though messy). If you want to parse
15 + 32 * 14^12 (or something like that, lol)
It's going to be more difficult. You need to create a token parsing module. I wrote one for JScript, I cant share unfortunately as the project is currently closed-source.
For the latter, just use split(though careful as these are regex expression and some need to be escaped).
I.e
consider the method:
String::Split(String deliminators, int count, StringSplitOptions options);
deliminators is an array of characters which will trigger a split.
count is the maximum number of splits that can occur
and StringSplitOptions are optional flags for the method.
Consider I have
Code:
String sBuffer = "15 + 32";
String[] sArray = sBuffer.Split(" ", 3, StringSplitOptions.RemoveEmptyEntries);
sArray[0] is equal to "15"
sArray[1] is equal to "+"
sArray[2] is equal to "32"