域名注册商平台,做网站seo优化的公司,青岛seo精灵,合肥高新城建设计院网站stritheima itcast boxuegu
# 统计字符串类有多少个“it”字符
count str.count(it)
print(f字符串类有{count}个“it”字符)
# 将字符串内的空格全部替换为字符#xff1a;“|”
str_replace str.replace( , |itheima itcast boxuegu
# 统计字符串类有多少个“it”字符
count str.count(it)
print(f字符串类有{count}个“it”字符)
# 将字符串内的空格全部替换为字符“|”
str_replace str.replace( , |)
print(f将字符串内的空格全部替换为字符“|”后得到的字符串为{str_replace})
# 按照“|”进行字符串分割得到列表
str_split str.split(|)
print(f按照“|”进行字符串分割得到的列表{str_split})