Hi, How to find number of characters in a string?
Following example returns byte count instead of number of characters. use std::string::String; fn main() { let unicode_str = String::from_str("ಅ"); let ascii_str = String::from_str("a"); println!("unicode str: {}, ascii str: {}", unicode_str.len(), ascii_str.len()); } -- Regards Aravinda | ಅರವಿಂದ http://aravindavk.in
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev