python學習之str.lstrip()

str.lstrip([chars])spa

刪除從開頭開始指定的字符串,而後返回結果字符串。blog

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

 必定要先刪除開頭的才能刪除後面的。ip

相關文章
相關標籤/搜索