Function truncate_words

Source
pub fn truncate_words(text: &str, max_length: usize) -> String
Expand description

截断文本到指定长度,保持单词完整性