Logo

Programming-Idioms

History of Idiom 110 > diff from v41 to v42

Edit summary for version 42 by nopeslide:
New Erlang implementation by user [nopeslide]

Version 41

2019-09-26, 20:40:16

Version 42

2019-09-27, 10:10:45

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 = string:is_empty(string:trim(S)).
Comments bubble
trimming the string to remove leading/trailing whitespaces and then checking if it's empty
Doc URL
http://erlang.org/doc/man/string.html