Logo

Programming-Idioms

History of Idiom 110 > diff from v12 to v13

Edit summary for version 13 by :
New Haskell implementation by user [antalsz]

Version 12

2016-02-16, 23:10:02

Version 13

2016-02-16, 23:21: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 Data.Char (isSpace)
Code
blank :: Bool
blank = all isSpace s