String S= "multiply 3 add add 3 3 1"
I want to get two string arrays The one is {"multiply", "add", "add"} Another out is {"3","3","3",1}
How can I get it? I tried to use
String operators[] = s.split("[0-9]+"); String operands[] =s.split("(?:add|multiply)"); But, it doesn't work.