Logo

Programming-Idioms

History of Idiom 110 > diff from v21 to v22

Edit summary for version 22 by Reiner Martin:
New Rust implementation by user [Reiner Martin]

Version 21

2016-04-07, 08:06:43

Version 22

2016-08-11, 20:10:16

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
let blank = s.trim().is_empty();
Doc URL
https://doc.rust-lang.org/std/string/struct.String.html#method.trim