Guest User

Untitled

a guest
Jul 17th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. fn char_info(text: &str) {
  2. println!("========");
  3. println!("Info {}", text);
  4. println!("Utf8 Bytes {:x?}", text.as_bytes());
  5. println!("len() => {}", text.len());
  6. println!("chars().count() => {}", text.chars().count());
  7. }
  8.  
  9. fn main() {
  10. char_info("a");
  11. char_info("ä");
  12. char_info("…");
  13. char_info("😀");
  14. char_info("😀");
  15. }
Add Comment
Please, Sign In to add comment