zoukankan      html  css  js  c++  java
  • StringUtils.defaultIfBlank

    StringUtils.defaultIfBlank
    在字符串为null,空串或者空白串的时候,返回指定的默认值。

    org.apache.commons.lang.StringUtils defaultIfBlank方法 写道
    public static String defaultIfBlank(String str, String defaultStr)

    Returns either the passed in String, or if the String is whitespace, empty ("") or null, the value of defaultStr.

    StringUtils.defaultIfBlank(null, "NULL") = "NULL"
    StringUtils.defaultIfBlank("", "NULL") = "NULL"
    StringUtils.defaultIfBlank(" ", "NULL") = "NULL"
    StringUtils.defaultIfBlank("bat", "NULL") = "bat"
    StringUtils.defaultIfBlank("", null) = null


    Parameters:
    str - the String to check, may be null
    defaultStr - the default String to return if the input is whitespace, empty ("") or null, may be null
    Returns:
    the passed in String, or the default

    //转载哪忘了,别人网上找到发给我的,抱歉!若作者发现麻烦评论区留一下地址,谢谢。

  • 相关阅读:
    Unix + OS IBM Aix System Director
    framework apache commons
    维吉尼亚密码
    破译换字式密码
    维吉尼亚密码表
    维吉尼亚密码表
    delete i;
    破译换字式密码
    破译换字式密码
    int *i = new int;
  • 原文地址:https://www.cnblogs.com/lucong-white/p/8917114.html
Copyright © 2011-2022 走看看