By jointed I mean:
let substring = "CNC";
And the string:
let s = "CNCNC";
In my version "jointed" would mean that there are 2 such substrings present.
What is the best way of doing that in Rust? I can think of a few but then it's basically ugly C.
I have something like that:
fn find_a_string(s: &String, sub_string: &String) -> u32 {
s.matches(sub_string).count() as u32
}
But that returns 1, because matches() finds only disjointed substrings.
What's the best way to do that in Rust?