当前位置:  首页>> 技术小册>> Python合辑2-字符串常用方法

24、endswith()

检查字符串是否是以指定内容结束,是则返回 True,否则返回 False。

  1. print('Patrick'.endswith('ck'))
  2. # True