I want to do calculator that do sums but just in one index like this:
args[0] = "2+2"
and the output should be 4
.
I want to do calculator that do sums but just in one index like this:
args[0] = "2+2"
and the output should be 4
.
I won't do your homework for you, but I'll split it in few steps:
Have a look at String.indexOf
and String.substring
for that. Make sure you check for -1 for indexOf
.
int foo = Integer.parseInt(String s);
Good luck!