python学习之str.lstrip()

str.lstrip([chars])

删除从开头开始指定的字符串,然后返回结果字符串。

>>> '://www.example.com'.lstrip('w://')
'.example.com'
>>> '://www.example.com'.lstrip('w')
'://www.example.com'

 一定要先删除开头的才能删除后面的。

原文地址:https://www.cnblogs.com/leomei91/p/7804203.html