Hello,
I'm writing a java method that takes a string of plus and minus operations, eg
"+1+2+3-5" and I want it to return an int of the answer.
I'm trying to do this as efficiently as possible. I've tried the String.split()
method, but it gets slightly confusing with the pluses and minuses.
Can anyone help? No, this isn't homework.