Logo

Programming-Idioms

History of Idiom 110 > diff from v19 to v20

Edit summary for version 20 by :
New Lua implementation by user [Nepta]

Version 19

2016-04-06, 19:16:31

Version 20

2016-04-07, 08:05:48

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 ~= nil and s:match("%S") ~= nil
Demo URL
http://codepad.org/uOOuuNQ6