Logo

Programming-Idioms

History of Idiom 110 > diff from v78 to v79

Edit summary for version 79 by programming-idioms.org:
[Java] Better demo link (shows code)

Version 78

2022-02-01, 23:52:16

Version 79

2022-02-24, 18:07:01

Idiom #110 Check if string is blank

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

Idiom #110 Check if string is blank

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

Imports
import org.apache.commons.lang3.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
http://commons.apache.org/proper/commons-lang/apidocs/org/apache/commons/lang3/StringUtils.html#isBlank-java.lang.CharSequence-
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
Demo URL
https://replit.com/@ProgIdioms/MidnightblueFixedRay#Main.java