Logo

Programming-Idioms

History of Idiom 110 > diff from v7 to v8

Edit summary for version 8 by :
New D implementation by user [piou]

Version 7

2016-01-08, 09:21:29

Version 8

2016-01-09, 17:08:38

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 std.algorithm;
import std.uni;
Code
bool blank = s.all!isSpace;
Doc URL
http://dlang.org/phobos/std_uni.html#.isSpace