Java Utililty Methods Array Empty Check

List of utility methods to do Array Empty Check

Description

The list of methods to do Array Empty Check are organized into topic(s).

Method

ListremoveEmptyStringsInArray(String[] array)
remove Empty Strings In Array
List<String> list = Arrays.asList(array);
return removeEmptyStringsInList(list);
ArrayListremoveNetLogoCommentsAndEmptyLines(String lines[])
remove Net Logo Comments And Empty Lines
ArrayList<String> result = new ArrayList<String>();
for (int i = 0; i < lines.length; i++) {
    String line;
    int semicolon = lines[i].indexOf(';');
    if (semicolon < 0) {
        line = lines[i];
    } else {
        line = lines[i].substring(0, semicolon);
...
String[]removeNullsAndEmptyString(final String[] strArray)
remove Nulls And Empty String
List<String> list = new ArrayList<String>(Arrays.asList(strArray));
list.removeAll(Arrays.asList("", null));
return list.toArray(new String[list.size()]);
String[]removeTrailingEmptyLines(String[] lines)
remove Trailing Empty Lines
ArrayList<String> linesList = new ArrayList<String>(Arrays.asList(lines));
boolean bEndEmptyLine = linesList.get(linesList.size() - 1).equals("");
while (bEndEmptyLine) {
    linesList.remove(linesList.size() - 1);
    bEndEmptyLine = linesList.get(linesList.size() - 1).equals("");
String[] newLines = new String[linesList.size()];
linesList.toArray(newLines);
...