pub fn string_is_subset(s: &str, t: &str) -> boolExpand description
Returns whether all of the first string slice’s characters are present in the second string slice.
Does not take multiplicities into account.
§Worst-case complexity
$T(n, m) = O(n + m)$
$M(n, m) = O(m)$
where $T$ is time, $M$ is additional memory, $n$ is s.len(), and $m$ is t.len(): the second
string’s characters are collected into a hash set, and the first string’s characters are checked
against it.
§Examples
use malachite_base::strings::string_is_subset;
assert_eq!(string_is_subset("oH, well", "Hello, world!"), true);
assert_eq!(string_is_subset("MMM", "Mississippi"), true);
assert_eq!(string_is_subset("Hello, World!", "Hello, world!"), false);
assert_eq!(string_is_subset("j", "Mississippi"), false);