my_str = "abc def ghi"
# index方法
index = my_str.index("de")
print(index)
# replace方法
replace = my_str.replace("b","m")
print(replace)
# split方法
split = my_str.split(" ")
print(split)
# strip方法
my_str = " abc def ghi "
new_my_str = my_str.strip()
print(new_my_str)
my_str = "68abc def ghi86"
new_my_str = my_str.strip("68")
print(new_my_str)
# 统计字符串中某字符出现次数
my_str = "abc abf ghi"
count = my_str.count("ab")
print(count)
# 统计字符串的长度
num = len(my_str)
print(num)