Logo

Programming-Idioms

History of Idiom 97 > diff from v38 to v39

Edit summary for version 39 by tkoenig:
New Fortran implementation by user [tkoenig]

Version 38

2019-09-28, 00:21:19

Version 39

2019-09-28, 11:48:56

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
  b = (s(len(s)-len(suffix)+1:) == suffix)