#1.upper(),lower(),capitalize()
s = "helLoPyThoN"
# 返回一个新的字符串
print(s.upper()) # 全部字母大写格式
print(s.lower()) # 全部字母小写格式
print(s.capitalize()) # 首字母大写格式
#2.find() 查找子字符串,返回子串的首字符索引
s = "I love python!"
print(s.find("love"))
print(s.find("py"))
print(s.find("hcon"))# 当不包含子串时,返回-1
#3.split()字符串分割,以列表形式返回分割后的部分
s = "Hello World"
s1 = "Hello:Wor:ld"
print(s.split()) #默认以空格作为分割字符
print(s1.split(":")) #指定以:作为分割字符
# 4.startswith(),endswith() # 判断字符串以xxx开头/结尾 返回布尔值
print("helloworld".startswith("a"))
print("helloworld".startswith("hel"))
print("helloworld".endswith("ld"))