How to remove null value from String array in java?
String[] firstArray = {\"test1\",\"\",\"test2\",\"test4\",\"\"};
I need the \"firstArra
If you actually want to add/remove items from an array, may I suggest a List instead?
String[] firstArray = {"test1","","test2","test4",""};
ArrayList list = new ArrayList();
for (String s : firstArray)
if (!s.equals(""))
list.add(s);
Then, if you really need to put that back into an array:
firstArray = list.toArray(new String[list.size()]);