Function truncate_string

Source
pub fn truncate_string(
    s: &str,
    length: usize,
    encoding: Encoding,
    check: bool,
) -> Result<Vec<u8>>
Available on crate feature utils-str only.
Expand description

Truncate a string to a specified length, encoding it with the given encoding. Output size may less than or equal to the specified length.