commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Whitford (JIRA)" <j...@apache.org>
Subject [jira] Created: (LANG-657) Add defaultIfBlank similar to defaultIfEmpty to StringUtils
Date Fri, 12 Nov 2010 23:56:23 GMT
Add defaultIfBlank similar to defaultIfEmpty to StringUtils
-----------------------------------------------------------

                 Key: LANG-657
                 URL: https://issues.apache.org/jira/browse/LANG-657
             Project: Commons Lang
          Issue Type: New Feature
          Components: lang.*
    Affects Versions: 2.5
         Environment: n/a
            Reporter: Anthony Whitford
            Priority: Minor


Similar to [StringUtils.defaultIfEmpty|http://commons.apache.org/lang/api-3.0-beta/org/apache/commons/lang3/StringUtils.html#defaultIfEmpty(T,
T)], I'd like to also see a {{defaultIfBlank}} method:
{code}
public static String defaultIfBlank (final String str, final String defaultStr) {
    return StringUtils.isBlank(str) ? defaultStr : str;
}
{code}


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message