Here you can find the source of removeEmptyStringsInList(List
public static List<String> removeEmptyStringsInList(List<String> list)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<String> removeEmptyStringsInList(List<String> list) { List<String> newList = new ArrayList<String>(); for (String s : list) { if (!s.isEmpty()) { newList.add(s.trim());// w ww . j ava 2s . co m } } return newList; } }