Logo

Programming-Idioms

History of Idiom 110 > diff from v1 to v2

Edit summary for version 2 by :
[Java]Typo Common -> Commons

Version 1

2015-12-29, 22:24:49

Version 2

2015-12-29, 22:25:37

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Imports
import org.apache.commons.lang.StringUtils;
Imports
import org.apache.commons.lang.StringUtils;
Code
boolean blank = StringUtils.isBlank(s);
Code
boolean blank = StringUtils.isBlank(s);
Comments bubble
This uses external library Apache Common Lang.
Comments bubble
This uses external library Apache Commons Lang.
Doc URL
https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringUtils.html#isBlank%28java.lang.String%29
Doc URL
https://commons.apache.org/proper/commons-lang/javadocs/api-2.6/org/apache/commons/lang/StringUtils.html#isBlank%28java.lang.String%29