daily pastebin goal
42%
SHARE
TWEET

Untitled

a guest Mar 25th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use core::char;
  2.  
  3. fn main() {
  4.     let encoded = "Hello_World".encode_utf16().collect::<Vec<u16>>();
  5.     println!("{:?}", encoded);
  6.     let decoded = char::decode_utf16(encoded).map(|v| v.unwrap()).collect::<Vec<char>>();
  7.     println!("{:?}", decoded);
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top