Logo

Programming-Idioms

History of Idiom 110 > diff from v97 to v98

Edit summary for version 98 by programming-idioms.org:
[Ruby] Added Doc URL for strip

Version 97

2022-07-02, 18:55:33

Version 98

2022-09-03, 10:19:31

Idiom #110 Check if string is blank

Set the boolean blank to true if the string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set the boolean blank to true if the string s is empty, or null, or contains only whitespace ; false otherwise.

Code
blank = s.strip.empty?
Code
blank = s.strip.empty?
Doc URL
https://ruby-doc.org/core-3.1.2/String.html#method-i-strip