2
隨着Python 2.7,我遇到了以下問題:我有我想要清理的urls,特別是我想擺脫「http://」。lstrip去除字母
這工作:
>>> url = 'http://www.party.com'
>>> url.lstrip('http://')
'www.party.com'
但爲什麼這個不行?
>>> url = 'http://party.com'
>>> url.lstrip('http://')
'arty.com'
它從'派對'中擺脫'p'。
謝謝你的幫助。