1. 判断字符串是否以某个内容开头/结尾
if str.startswith("aa_") :
例如字符串str = “aa_bb”,那么str.startswith("aa_") 结果为True
if str.endswith("aa"):
2.得到字符串的长度
length = len(str)
1. 判断字符串是否以某个内容开头/结尾
if str.startswith("aa_") :
例如字符串str = “aa_bb”,那么str.startswith("aa_") 结果为True
if str.endswith("aa"):
2.得到字符串的长度
length = len(str)