Logo

Programming-Idioms

History of Idiom 110 > diff from v55 to v56

Edit summary for version 56 by programming-idioms.org:
[Java] +DemoURL

Version 55

2020-11-26, 12:14:15

Version 56

2020-11-26, 12:26:28

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.lang3.StringUtils;
Code
boolean blank = StringUtils.isBlank(s);
Code
boolean blank = StringUtils.isBlank(s);
Comments bubble
This uses external library Apache Commons 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
http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isBlank-java.lang.CharSequence-
Demo URL
https://repl.it/@ProgIdioms/MidnightblueFixedRay