3

Drain in std::string - Rust

 2 years ago
source link: https://doc.rust-lang.org/stable/std/string/struct.Drain.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

pub fn as_str(&self) -> &str

Returns the remaining (sub)string of this iterator as a slice.

Examples

let mut s = String::from("abc");
let mut drain = s.drain(..);
assert_eq!(drain.as_str(), "abc");
let _ = drain.next().unwrap();
assert_eq!(drain.as_str(), "bc");
Run

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK