Skip to content

Glossary: Rust Basics

to_string

Also written: to_string()

A method that turns a `&str` into a new, owned `String`, much like `String::from`.

Where the book teaches it

Related terms

StringString literal