Logo

Programming-Idioms

History of Idiom 96 > diff from v9 to v10

Edit summary for version 10 by :

Version 9

2015-10-29, 14:05:17

Version 10

2015-10-31, 15:35:50

Idiom #96 Check string prefix

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

Idiom #96 Check string prefix

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

Code
b =s.startswith(prefix)
Doc URL
https://docs.python.org/3/library/stdtypes.html#str.startswith