I have the following:
String string = \"1-50 of 500+\"; String[] stringArray = string.split(\" \");
Printing out all the elements in this
Your Program is correct but you put two space after 1-50. So Its giving you that output. Remove one space and you are done. No need to change the code. But if there is a two space then you should use string.split("\\s+")
1-50
string.split("\\s+")