Skip to content

Glossary: Rust Basics

lines / split

Also written: lines(), split(), strip_prefix, trim

Text methods: `lines()` gives each line, `split(",")` each piece between commas, `trim()` removes spaces at both ends, and `strip_prefix` returns the text after a given start if it matches. The first two are iterators.

Where the book teaches it

Related terms

IteratorcollectString literal