Function konst::slice::bytes_trim_end_matches[][src]

pub const fn bytes_trim_end_matches<'a>(
    this: &'a [u8],
    needle: &[u8]
) -> &'a [u8]
Expand description

Removes all instances of needle from the end of this.

Example

use konst::slice;

const TRIMMED: &[u8] = slice::bytes_trim_end_matches(b"oowowooooo", b"oo");

assert_eq!(TRIMMED, b"oowowo");