Logo

Programming-Idioms

History of Idiom 110 > diff from v88 to v89

Edit summary for version 89 by Li Ding:
New Rust implementation by user [Li Ding]

Version 88

2022-05-05, 08:34:31

Version 89

2022-05-23, 17:23:55

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
str.chars().all(|c| c.is_whitespace())
Doc URL
https://doc.rust-lang.org/std/primitive.char.html#method.is_whitespace