What is Nostr?
dave /
npub1tsg…htk4
2023-02-10 08:32:58
in reply to nevent1q…7p69

dave on Nostr: Okay, let's use the first function but with a slight modification and remove the ...

Okay, let's use the first function but with a slight modification and remove the extra method call:

fn common_char_functional(str1: &str, str2: &str) -> &str {
let common_chars = str1.chars()
.filter(|ch1| str2.contains(*ch1))
.collect::<String>();

common_chars.as_str()
}
Author Public Key
npub1tsgw6pncspg4d5u778hk63s3pls70evs4czfsmx0fzap9xwt203qtkhtk4