Java List Remove removeBlankLine(List lines)

Here you can find the source of removeBlankLine(List lines)

Description

remove Blank Line

License

Apache License

Declaration

public static List<String> removeBlankLine(List<String> lines) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<String> removeBlankLine(List<String> lines) {
        List<String> result = new ArrayList<String>();
        for (String line : lines) {
            if (line == null) {
                continue;
            }//from   ww w.  j  ava 2s  . c  o  m
            String temp = line.trim();
            if (temp.length() == 0) {
                continue;
            }
            result.add(line);
        }
        return result;
    }
}

Related

  1. removeAll(List strings, String string)
  2. removeAll(List list, List indexes)
  3. removeAll(List toRemoveFrom, Collection elementsToRemove)
  4. removeAllNull(List list)
  5. removeAllNulls(List list)
  6. removeByRef(List list, Object obj)
  7. removeElement(T element, List list)
  8. removeElementsFromList(List inputList, List elementsToRemove)
  9. removeEmpties(List original)