Given the following two strings:
let subject: &str = "zoop-12";
let trail: &str "-12";
How would I go about removing trail from subject only once? I would only like to do this in the case that subject has these characters at its end, so in a case like this I would like nothing removed:
let subject: &str "moop-12loop";
let not_a_trail: &str = "-12";
I'm okay with either being a String or &str, but I choose to use &str for brevity.