Trim

Function Trim 

Source
pub fn Trim(s: &[byte], cutset: impl AsRef<[byte]>) -> &[byte] 
Expand description

Trim returns a subslice of s by slicing off all leading and trailing UTF-8-encoded code points contained in cutset.

zh-cn 返回将s前后端所有cutset包含的utf-8码值都去掉的子切片。

§Example

use gostd_bytes as bytes;

assert_eq!("Hello, 中国".as_bytes(),bytes::Trim("¡¡¡Hello, 中国!!!".as_bytes(), "!¡".as_bytes()));