I want to split a String, using " " but .split() gives me empty strings in the array, which I don't want.
I tried this:
String[] arr = " hello world! b y e ".split(" ",0);
Output:
["", "", "", "", "", "hello" and so on....
Expected Output:
["hello","world!","b","y","e"]
How can I achieve this?