rust - Check if a string is empty or blank -
what is the correct way to check whether a string is empty or not) & amp; Str b) string? I used to do it with "aaa" .len () == 0
, but do I want another way as my stomach?
both and str
and string
is_empty ".is_empty (), true); assert_eq! (" ".to_string () .is_empty (), true); / Code>
Comments
Post a Comment