All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.apetrelli.gwtintegration.util.shared.StringUtils Maven / Gradle / Ivy

The newest version!
package com.github.apetrelli.gwtintegration.util.shared;

public class StringUtils {

	private StringUtils() {}
	
    /**
     * Got from Apache Commons Lang.
     * 
     * 

Checks if a String is whitespace, empty ("") or null.

* *
     * StringUtils.isBlank(null)      = true
     * StringUtils.isBlank("")        = true
     * StringUtils.isBlank(" ")       = true
     * StringUtils.isBlank("bob")     = false
     * StringUtils.isBlank("  bob  ") = false
     * 
* * @param str the String to check, may be null * @return true if the String is null, empty or whitespace * @since 2.0 */ @SuppressWarnings("deprecation") public static boolean isBlank(String str) { int strLen; if (str == null || (strLen = str.length()) == 0) { return true; } for (int i = 0; i < strLen; i++) { if ((Character.isSpace(str.charAt(i)) == false)) { return false; } } return true; } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy