I want to convert a string (contains empty string " ") to a string[] with out " "
Here is the source code:
String[] s4 = " 1 10.25 3.3 0.32 ".split(" ");
String[] s5 = null;
int i1 =0;
for (int i = 0; i<s4.length;i++){
if (s4[i] != " "){
s5[i1] = s4[i]; //here "java.lang.NullPointerException" error
i1++;
}
}
//expected result s5 = ["1","10.25","3.3","0.32"]

