Logo

Programming-Idioms

History of Idiom 96 > diff from v30 to v31

Edit summary for version 31 by TheVTM:
[Rust] Fixed demo link

Version 30

2017-04-27, 08:53:05

Version 31

2017-04-29, 07:18:29

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);
Code
let b = s.starts_with(prefix);
Doc URL
https://doc.rust-lang.org/std/string/struct.String.html#method.starts_with
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
Origin
https://doc.rust-lang.org/std/string/struct.String.html#method.starts_with
Demo URL
https://is.gd/7sbAkF
Demo URL
https://play.rust-lang.org/?gist=4b9206236f264d32ba62af8ccf73a9c1&version=stable&backtrace=0