Function rsplit

Source
pub const fn rsplit<'a, 'b>(this: &'a str, delim: &'b str) -> RSplit<'a, 'b>
Expand description

Const equivalent of str::rsplit, which only takes a &str delimiter.

§Version compatibility

This requires the "rust_1_64" feature.

§Example

use konst::string;
use konst::iter::collect_const;

const STRS: [&str; 3] = collect_const!(&str => string::rsplit("foo-bar-baz", "-"));

assert_eq!(STRS, ["baz", "bar", "foo"]);