Checks if given String is blank (see {@link #isBlank(String)}.<br>
If String is blank, the given default is returned, otherwise the String is returned.
@param _str string to check
@param _default default in case of blank string
@return _str or _default
344923
public static String defaultIfBlank(String _str, String _default) {
        return isBlank(_str) ? _default : _str;
    }
902719
public static boolean isEmpty(String str) {
        if (str == null)
            return true;
        if ("".equals(str.trim()))
            return true;
        return str.isEmpty();
    }
1204939
def add_blank_option(regexp, blank)
      case blank
        when String then Regexp.union(regexp, Regexp.new(Regexp.quote(blank)))
        when true then   Regexp.union(regexp, //)
        else regexp
      end
    end
1277700
public static boolean isEmpty(@Nullable String str) {
        if (str == null || str.length() == 0) {
            return true;
        }
        return false;
    }
1088755
public static String trim(String str) {
		return str != null && str.length() > 0 ? str.trim() : str;
	}
566139
public static boolean compare(@Nullable String str1, @Nullable String str2)
  {
    return (str1 == null ? str2 == null : str1.equals(str2));
  }
81399
public static boolean isEmpty(final String aString) {
        boolean result = true;

        if (aString != null) {
            for (int index = 0; index < aString.length(); index++) {
                if (!Character.isWhitespace(aString.charAt(index))) {
                    result = false;
                    break;
                }
            }
        }

        return result;
    }
895970
private int getIntValue(String str, int defaultValue) {

        try {
            int intValue = Integer.parseInt(str);
            return (intValue > 0) ? intValue : defaultValue;
        } catch (NumberFormatException e) {
            // intentionally left blank
        }
        return defaultValue;
    }
481623
public static final boolean toBoolean(String str, boolean trueIfNull) {
        if (str == null && trueIfNull) {
            return true;
        }

        return toBoolean(str);
    }
34887
public static boolean isFirstCap(String str) {
    	if (isAllCap(str)) return false;
    	
		if (str.length() > 0 && Character.isLetter(str.charAt(0)) &&
				Character.isUpperCase(str.charAt(0))) {
		    return true;
		}
		
		return false;
    }
111925
protected String getValue(String str) {
        int index = str.indexOf('=');
        String value = null;
        if (index > 0) {
            value = str.substring(index + 1).trim();
            if (value.charAt(0) == '\"') {
                value = value.substring(1, value.length() - 1);
            }
        }
        return value;
    }
474697
private static boolean isDefaultStringAttributeValue(String value)
    {
        if (value == null)
        {
            return true;
        }
        else if (value.length() == 0)
        {
            return true;
        }
        else
        {
            return false;
        }
    }
434708
def _check_default(value, parameter, default_chars):
    ''''''
    # not using a set here because it fails when value is unhashable
    if value in default_chars:
        if parameter.default is inspect.Parameter.empty:
            raise ValueError('Value was empty, but no default value is given in view function for parameter: {} ({})'.format(parameter.position, parameter.name))
        return parameter.default
    return value
29238
public static String checkNotEmpty(String str, String message) {
        if (checkNotNull(str).isEmpty()) {
            throw new IllegalArgumentException(message);
        }
        return str;
    }
724816
public static function blank(string $str, string $encoding = null) : bool
    {
        return static::matchesPattern($str, '^[[:space:]]*$', $encoding);
    }
594651
public static boolean isEmpty(String aString)  {
    	boolean result = true;
    	if (aString != null && aString.trim().length()>0) { 
    		if (!aString.trim().toUpperCase().equals("NULL")) { 
    		   result = false;
    		}
    	}
    	return result;
    }
971184
@Trivial
    private boolean isStringValueUndefined(Object str) {
        if (str instanceof SerializableProtectedString) {
            // Avoid constructing a String from a ProtectedString
            char[] contents = ((SerializableProtectedString) str).getChars();
            for (char ch : contents)
                if (ch > '\u0020')
                    return false; // See the description of String.trim()
            return true;
        } else {
            return (str == null || ((String) str).trim().isEmpty());
        }

    }