Skip to main content

display_width

Function display_width 

Source
pub fn display_width(s: &str) -> usize
Expand description

Calculate display width of a string (handles CJK characters)

ASCII characters occupy 1 terminal cell; CJK and other wide characters occupy 2.