Java Array Value Any anyAreEmpty(String... words)

Here you can find the source of anyAreEmpty(String... words)

Description

Return whether any of the input strings are empty or null.

License

Open Source License

Parameter

Parameter Description
words the array of words to check

Return

true if any of the words are empty or null

Declaration

public static boolean anyAreEmpty(String... words) 

Method Source Code

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

public class Main {
    /**//from  w  w w.  ja v  a 2s .  c om
     * Return whether any of the input strings are empty or null.
     *
     * @param words the array of words to check
     * @return true if any of the words are empty or null
     */
    public static boolean anyAreEmpty(String... words) {

        for (String word : words) {
            if ((word == null) || word.isEmpty()) {
                return true;
            }
        }

        return false;
    }
}

Related

  1. any(boolean[] b)
  2. any(boolean[] values)
  3. any(final String a, final String b)
  4. anyBlank(String... ss)
  5. anyEmpty(final String head, final String... tail)
  6. anyEmpty(String[] array)
  7. anyEmptyField(String[] items)