1.判断一个字符串的开头和结尾
s1 = 'https://github.com/solaris-meng/yushan2/blob/master/baiduapi/views.py'
print(s1.startswith('http://'))
print(s1.endswith('py'))
mengan:cookbook mengan$ python strstart.py
False
True
1.判断一个字符串的开头和结尾
s1 = 'https://github.com/solaris-meng/yushan2/blob/master/baiduapi/views.py'
print(s1.startswith('http://'))
print(s1.endswith('py'))
mengan:cookbook mengan$ python strstart.py
False
True
本文标题:字符串操作
本文链接:https://www.haomeiwen.com/subject/hhjssttx.html
网友评论