Literal quantity
Http://doc.rust-lang.org/reference.html#literals
The literal is placed in the compiled binary static data segment.
STR literal reference
A string reference created using string literals whose lifetime is ' static '. In another way: a &str created from the form of a String whose lifetime is non-' static '.
&str is not to be move. Because it is a reference to a string entity in another place, this entity is owned by another principal (or static).
Conversion of &STR to String
STR &a_string &a_string[.]
Both str and string are UTF-8 streams. As a result, their byte lengths may actually be different from the "length" of the literal you enter (most of the characters in the text correspond to 3 bytes).
A_str.len () returns the number of bytes
&str and &[u8] are the same.
Reference:
Http://doc.rust-lang.org/std/primitive.str.html
String formatting
{}
format!
Search substitution matching for strings
Rust's str and string