1
whywhywhy 2014-11-29 00:51:22 +08:00
url='http://www.test.com/a=1&b=2&c=3'
print url.split('&c=')[0] |
2
irainy 2014-11-29 01:30:35 +08:00
'&'.join(url.split('&')[:-1])
|
3
KentY 2014-12-02 02:35:21 +08:00 via iPhone
手机cp/paste不方便,你就re.sub(u'&[^&]*$','',url)就好了吧
|