lstrip removed additional character, please help me understand it why. Is it removing all the input characters from the beginning?
'http://twitter.com/c_renwick'.lstrip('http://twitter.com/')
>>>'_renwick'
lstrip removed additional character, please help me understand it why. Is it removing all the input characters from the beginning?
'http://twitter.com/c_renwick'.lstrip('http://twitter.com/')
>>>'_renwick'
lstrip
takes a list of characters to remove from the string. As c
is in the list you provided, it gets removed
To achieve what you actually want, use replace:
'http://twitter.com/c_renwick'.replace('http://twitter.com/','')