pub fn TrimSuffix(s: &[byte], suffix: impl AsRef<[byte]>) -> &[byte] ⓘExpand description
TrimSuffix returns s without the provided trailing suffix string. If s doesn’t end with suffix, s is returned unchanged.
zh-cn
返回去除s可能的后缀suffix的子切片。§Example
use gostd_bytes as bytes;
assert_eq!("test".as_bytes(),bytes::TrimSuffix("test.rs".as_bytes(),".rs".as_bytes()))