The code I used to split the string with any number of white space is
String out="SELECT * FROM EMP WHERE EMPID=10";
String array[] = out.split("\\s+");
I want to include the white spaces in the "out" string into the array[] object while splitting with white spaces. The output I want is:
array[]={"SELECT","[WHITE SPACE]","*","[WHITE SPACE]","FROM","[WHITE SPACE]","EMP","[WHITE SPACE]","WHERE","[WHITE SPACE]","EMPID=10"}
But the output what I am getting is:
array[]={"SELECT","*","FROM","EMP","WHERE","EMPID=10"}
Any help will be appreciated