I have a string input which looks like this:
String equation = "(5.5 + 65) - 33".
How would I go about separating these elements into an array which looked like this:
String array = {"(", "5.5", "+", "65", ")", "-", "33"}
I tried using the string split()
method but because of there being no spaces between the parenthesis and the next digit it produces the incorrect format of:
String array = {"(5.5", "+"