Suppose I have a simple string that I want to parse into array of string:
"add (multiply (add 1 2) (add 3 4)) (add 5 6)"
How do I parse it into 3 strings (based on outer parentheses):
add
(multiply (add 1 2) (add 3 4))
(add 5 6)
With my OOP mind, I think I need a for loop index and if else statement to do this.
I have tried parse it with string split, however I got:
command
(multiply
1
(add
3
2))
(add
3
4)
which is not what I expected