Logo

Programming-Idioms

History of Idiom 97 > diff from v28 to v29

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

Version 28

2017-04-27, 09:23:17

Version 29

2017-04-29, 07:10:00

Idiom #97 Check string suffix

Set boolean b to true if string s ends with string suffix, false otherwise.

Illustration

Idiom #97 Check string suffix

Set boolean b to true if string s ends with string suffix, false otherwise.

Illustration
Extra Keywords
tail
Extra Keywords
tail
Code
let b = s.ends_with(suffix);
Code
let b = s.ends_with(suffix);
Doc URL
https://doc.rust-lang.org/std/string/struct.String.html#method.ends_with
Doc URL
https://doc.rust-lang.org/std/string/struct.String.html#method.ends_with
Origin
https://doc.rust-lang.org/std/string/struct.String.html#method.ends_with
Origin
https://doc.rust-lang.org/std/string/struct.String.html#method.ends_with
Demo URL
https://is.gd/BsZiyY
Demo URL
https://play.rust-lang.org/?gist=228daca7e95f2cb964d0ccd8c4c602f7&version=stable&backtrace=0