On this page
article
Slicing a Vector
Slicing a Vector
Get Slice Imagine a situation where you need to get a portion of a vector. Rust allows you to borrow the slice of the vector instead of using the whole vector.
Syntax Slice is a two-word object. The first word is a pointer to the data, and the second word is the length of the slice.
output
Quiz
Test your understanding of vector array slicing in Rust!
Last updated a year ago.