Potential `rsplit_inclusive`?

Currently, Rust has a split_inclusive method on slices and string slices to split a string by a pattern, and keep the separator as the end of the first string. Recently I found myself reaching for a complementary rsplit_inclusive that would instead keep the separator as the beginning of the string closest to the end of the slice. Most of the split methods already have an rsplit equivalent where it makes sense, so the lack here seems like an oversight?

Seems like a reasonable addition to me.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.