When processing a string, sometimes it is necessary to check whether the string starts with a certain prefix or ends with a certain suffix. At this time, you can use the startswith() and endswith() functions, as shown in the table.
Next, demonstrate the usage of these two functions, as shown in the example.
4.5.3 Python, detect prefix or suffix
Guess you like
Origin blog.csdn.net/weixin_43398418/article/details/110171484
Ranking