Logo

Programming-Idioms

History of Idiom 97 > diff from v5 to v6

Edit summary for version 6 by :

Version 5

2015-10-18, 16:00:03

Version 6

2015-10-28, 01:50:21

Idiom #97 Check string suffix

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

Idiom #97 Check string suffix

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

Code
$b = $suffix eq substr($s, -length($suffix));