I have following String Array
tmp = [null, null, null, Mars, Saturn, Mars]
coming after doing the operation -
allSig[d3].split(\" \");
where
Abstracting @az answer, this applies to any class type:
@SuppressWarnings("unchecked")
public static <T> T[] clean(T[] a) {
List<T> list = new ArrayList<T>(Arrays.asList(a));
list.removeAll(Collections.singleton(null));
return list.toArray((T[]) Array.newInstance(a.getClass().getComponentType(), list.size()));
}