📅  最后修改于: 2022-03-11 14:46:07.745000             🧑  作者: Mango
text = " hello "
text = text.lstrip() # lstrip == left strip
>>> ' hello'
text = text.rstrip() # rstrip == right strip
>>> 'hello '
text = text.strip() # strip == strip from both sides
>>> 'hello'