📅  最后修改于: 2022-03-11 14:45:19.243000             🧑  作者: Mango
>>> a = "this is a string"
>>> a = a.split(" ") # a is converted to a list of strings.
>>> print a
['this', 'is', 'a', 'string']
>>> a = "-".join(a)
>>> print a
this-is-a-string