Here you can find the source of removeEmptyLines(String lines[])
public static ArrayList<String> removeEmptyLines(String lines[])
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static ArrayList<String> removeEmptyLines(String lines[]) { ArrayList<String> result = new ArrayList<String>(); for (int i = 0; i < lines.length; i++) { if (!lines[i].trim().isEmpty()) { result.add(lines[i]);//from w w w .j av a 2 s. co m } } return result; } }