Skip to main content

chunk_message

Function chunk_message 

Source
pub fn chunk_message(text: &str, limit: usize) -> Vec<String>
Expand description

Split text into chunks of at most limit characters (not bytes), so a multi-byte UTF-8 sequence is never split mid-codepoint. Returns an empty vec for empty input (callers should skip sending in that case).