python str.startswith()

python str.startswith()
用途:与str.endwith()相反,判断字符串是否以指定前缀开始。
语法:str.startwith(prefix[, start[, end]]):
示例1:
s = 'Apollo'
s.startswith('Ap')
print(s.startswith('Ap'))
打印结果:True
示例2:
s = 'Apollo'
s.startswith('po')
print(s.startswith('po',1,4))
打印结果:True
示例3:
s = 'Apollo'
s.startswith('Apo')
print(s.startswith('Apo',1,4))
打印结果:False
View Code

 

上一篇:django.core.exceptions.ImproperlyConfigured: mysqlclient 1.3.13 or newer is required; you have 1.3.1


下一篇:Required request body is missing: public错误