pub fn TrimFunc(s: &[byte], f: fn(rune) -> bool) -> &[byte] ⓘExpand description
TrimFunc returns a subslice of s by slicing off all leading and trailing UTF-8-encoded code points c that satisfy f(c).
zh-cn
返回将s前后端所有满足f的unicode码值都去掉的子切片。§Example
use gostd_strings as strings;
let f = |x| x >= '1' as u32 && x <= '9' as u32;
assert_eq!("Hello, Rust",strings::TrimFunc("2211345Hello, Rust1122345", f));