Logo

Programming-Idioms

History of Idiom 110 > diff from v11 to v12

Edit summary for version 12 by :
New Python implementation by user [TinyFawks]

Version 11

2016-02-16, 21:08:42

Version 12

2016-02-16, 23:10:02

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.

Code
blank = s is None or s == '' or s.isspace()