Skip to content

Glossary: Rust Basics

Slice

Also written: string slice, slices

A borrowed view of part of a text or collection, written with a range like `&order[0..6]`. A string slice has the type `&str` and copies nothing.

Where the book teaches it

Related terms

String literalRangeReference