📜  python代码示例中的rstrip

📅  最后修改于: 2022-03-11 14:46:07.745000             🧑  作者: Mango

代码示例2
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'