# note: r 表示 right!
>>> name = "Sheep Core "
>>> name.rstrip()
'Sheep Core' #已经去掉末尾空格
>>> name = " Sheep Core"
>>> name.lstrip()
'Sheep Core' # 已经去掉字符串中开头的多个空格
>>> name = " Sheep Core "
>>> name.strip()
'Sheep Core' # 已经去掉字符串左右两边冗余的空格
note: replace() 不会修改原字符串
# replace(old, new, count)
>>> stars = " I love you "
>>> stars.replace(" ", "*")
'**I*love*you**' # 已将空格全部替换成星星
# 可修改替换个数,比如只替换开头两个空格
>>> stars.replace(" ", "*", 2)
'**I love you '
>>> a = "I love python"
>>> b = a.split()
>>> b
['I', 'love', 'python']
>>> " ".join(b)
'I love python'