Java List Remove removeEmpties(List original)

Here you can find the source of removeEmpties(List original)

Description

Simple removes empty string from given list

License

Open Source License

Parameter

Parameter Description
original The original string list

Return

The result as list

Declaration

public static List<String> removeEmpties(List<String> original) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    /**/*  www .  j a  v  a2 s.  c o  m*/
     * Simple removes empty string from given list
     *
     * @param original The original string list
     * @return The result as list
     */
    public static List<String> removeEmpties(List<String> original) {
        List<String> l = new ArrayList<>(original);
        l.removeAll(Arrays.asList("", null));
        return l;
    }
}

Related

  1. removeAllNulls(List list)
  2. removeBlankLine(List lines)
  3. removeByRef(List list, Object obj)
  4. removeElement(T element, List list)
  5. removeElementsFromList(List inputList, List elementsToRemove)
  6. removeEmpty(List strings)
  7. removeEmptyColumns(List data)
  8. removeEmptyLines(List lines)
  9. removeEmptyLinesFromEnd(List list)