Let's say I have a string: "(2 * 32) + 5 ^ 2"
I'd like to turn this into a String array: [(2, *, 32, ), +, 5, ^, 2]
i.e. I don't want to capture spaces in the original string and I want to split by whitespace characters.
So I tried string.split**("\\s+")** but the result looks like [(2,*,32), +, 5, ^, 2].
Can someone explain why it doesn't split "(2" into (,2? Thank you!