I'm reading input from a user which will consist of all digits. I will read these digits into an integer array and then intersparse them with operators such as + and -.

My question is, after I do this, how do I evaluate this expression to an integer?

I.E.

I read in >>>>> "123456", then I manipulate the integer array to >>>>> "12+3456"

Now, what do I do to evaluate that array so that it is the integer 3468?

My question is, after I do this, how do I evaluate this expression to an integer?

I.E.

I read in >>>>> "123456", then I manipulate the integer array to >>>>> "12+3456"

Now, what do I do to evaluate that array so that it is the integer 3468?