Logo

Programming-Idioms

History of Idiom 96 > diff from v29 to v30

Edit summary for version 30 by TheVTM:
New Rust implementation by user [TheVTM]

Version 29

2017-03-06, 21:22:34

Version 30

2017-04-27, 08:53:05

Idiom #96 Check string prefix

Set boolean b to true if string s starts with prefix prefix, false otherwise.

Illustration

Idiom #96 Check string prefix

Set boolean b to true if string s starts with prefix prefix, false otherwise.

Illustration
Code
let b = s.starts_with(prefix);
Doc URL
https://doc.rust-lang.org/std/string/struct.String.html#method.starts_with
Origin
https://doc.rust-lang.org/std/string/struct.String.html#method.starts_with
Demo URL
https://is.gd/7sbAkF