Files
third_party_rust_unicode-width/README.md
T
2015-04-13 20:54:21 -04:00

755 B

unicode_width

Determine displayed width of char and str types according to Unicode Standard Annex #11 rules.

Build Status

extern crate unicode_width;

use unicode_width::UnicodeWidthStr;

fn main() {
    let teststr = "Hello, world!";
    let width = UnicodeWidthStr::width(teststr);
    println!("{}", teststr);
    println!("The above string is {} columns wide.", width);
    let width = teststr.width_cjk();
    println!("The above string is {} columns wide (CJK).", width);
}

Documentation