In Chapter 1, Getting Started with Rust, we mentioned that strings are of two types. In this section, we'll give a clearer picture on strings, their peculiarities, and how they differ from strings in other languages.
While other languages have a pretty straightforward story on string types, the String type in Rust is one of the tricky and uneasy types to handle. As we know, Rust places distinction on whether a value is allocated on the heap or on the stack. Due to that, there are two kinds of strings in Rust: owned strings (String) and borrowed strings (&str). Let's explore both of them.