I just realized a super blunder, I have committed all my life
url = 'abcdc.com'
print url.strip('.com')
Expect: abcdc
Resut: abcd
Instead try
url.rsplit('.com', 1)
strip function takes in an array of characters and chops any pattern of characters in the array.. :(
Wednesday, June 24, 2009
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment