I want to string split the following String
String ToSplit = "(2*(sqrt 9))/5";
into the following array of String:
String[] Splitted = {"(", "2", "*", "(", "sqrt", "9", ")", ")", "/", "5"};
As you can see the string ToSplit doesn't have spaces and I am having a hard time splitting the word " sqrt " from the rest of the elements because it is a full word. I am doing:
String[] Splitted = ToSplit.split("");
and the word " sqrt " is splitted into {"s", "q", "r", "t"} (obviously) and I want it splitted as the whole word to get the String splitted as shown above
How can I separate the word " sqrt " (as 1 element) from the others ?
Thanks in advance.