Samael Bate created LANG-1640:
---------------------------------

             Summary: please add StringUtils.isAnyNull method
                 Key: LANG-1640
                 URL: https://issues.apache.org/jira/browse/LANG-1640
             Project: Commons Lang
          Issue Type: New Feature
            Reporter: Samael Bate


isAnyBlank and isAnyEmpty are helpful but today I've encountered and issue 
where I am actually happy to have empty strings but need to ensure none of the 
String values in my array are null. 

I'd like to check for:

{noformat}
String[] strings = new String[] { "", null, " ", "fine"};

StringUtils.isAnyNull(strings);
{noformat}

Perhaps worth adding:

{noformat}
    public static boolean isAnyNull(final CharSequence... css) {
      if (ArrayUtils.isEmpty(css)) {
        return false;
      }
      for (final CharSequence cs : css) {
        if (cs == null) {
          return true;
        }
      }
      return false;
    }
{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to