pub fn trim(s: &[u8]) -> &[u8] ⓘ
Expand description
Trim a string from both starting and ending white spaces
§Examples
let a = b" Hello, World! ";
let slice = rust_rcs_core::internet::syntax::trim(a);
assert_eq!(slice, b"Hello, World!");
Trimming a string full of white spaces should yield an empty slice
let a = b" \t ";
let slice = rust_rcs_core::internet::syntax::trim(a);
assert_eq!(slice, b"");