If i have the user enter a string such as:
7+4-(18/3)/2
So far i have had to have the user enter a space between each number or operator, i don't wish to do this anymore. How would i create an array from the given string where the string is split at either a number or an operator so in this case the array would be:
[7, +, 4, -, (, 18, /, 3, ), /, 2]
(The array is of type String)
Any help would be really appreciated
Thanks

New Topic/Question
Reply


MultiQuote



|