Here you can find the source of removeEmptyString(String[] strOrigin)
public static String[] removeEmptyString(String[] strOrigin)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { /**//from w ww.jav a 2 s . c o m * Remove empty string elements from origin string array * @return String array */ public static String[] removeEmptyString(String[] strOrigin) { List<String> strList = new ArrayList<String>(); for (String str : strOrigin) { if (str != null && !str.trim().isEmpty()) { strList.add(str); } } return strList.toArray(new String[0]); } }