Java Array Empty Check removeNullsAndEmptyString(final String[] strArray)

Here you can find the source of removeNullsAndEmptyString(final String[] strArray)

Description

remove Nulls And Empty String

License

Open Source License

Declaration

public static String[] removeNullsAndEmptyString(final String[] strArray) 

Method Source Code

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

import java.util.ArrayList;
import java.util.Arrays;

import java.util.List;

public class Main {
    public static String[] removeNullsAndEmptyString(final String[] strArray) {
        List<String> list = new ArrayList<String>(Arrays.asList(strArray));

        list.removeAll(Arrays.asList("", null));

        return list.toArray(new String[list.size()]);
    }/*from w  w  w  .j av  a2  s  . c om*/
}

Related

  1. removeEmptyString(final String[] words)
  2. removeEmptyString(String[] strOrigin)
  3. removeEmptyStrings(String[] data)
  4. removeEmptyStringsInArray(String[] array)
  5. removeNetLogoCommentsAndEmptyLines( String lines[])
  6. removeTrailingEmptyLines(String[] lines)