7 lines
232 B
Python
7 lines
232 B
Python
my_str = "itheima itcast boxuegu"
|
|
count =my_str.count("it")
|
|
print(f"字符串中共有{count}个“it”字符")
|
|
new_my_str = my_str.replace(" ","|")
|
|
print(f"{new_my_str}")
|
|
my_str_list = new_my_str.split("|")
|
|
print(f"{my_str_list}") |