Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.009 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'removes': 0.07; 'subject:bug': 0.07; 'string': 0.09; 'occurrences': 0.09; 'trailing': 0.09; 'question.': 0.14; '24,': 0.16; 'backslash': 0.16; 'substring': 0.16; 'wrote:': 0.18; 'feb': 0.22; 'header:In- Reply-To:1': 0.27; 'characters': 0.30; 'message- id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; '>>>>': 0.31; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'subject:?': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'forward': 0.65; '2015': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=pPIj39Ou/cI73hoADvbpJCxVG36jytvT9RHnAleM7w0=; b=VtbDtnGS8LNyxcJ6TR8XkkkMsPRI307bmcXRzYdtcdNKeMRNUTvlJm6kjRdVGRibZf WqzlddLTPqi8pGcxFfoTkdqvYoD5B4jh53El5+kx0hx8UaxW5SRPs8uhf2qDQo7XMmM0 kLBOTWP1+sGoUVi9ZKXmiV2eWEXvPQmNPlwuwEELgQ+pO4efNth2oCEl9F4m7QXvzv49 GKZ1cdE2ZmkVcASCiChlUec+hBESFhzRgH8oLuEW86ru3mPCCMLY7rchClnoY+vuReju 2KnVzZ1iegWTVlPlQIkybYFb/UyTnJSx5ImMb+m2qTNJYIktfIgmMHFRCS0rkLGBMNlw CKBA== X-Received: by 10.66.178.139 with SMTP id cy11mr383382pac.146.1424819857632; Tue, 24 Feb 2015 15:17:37 -0800 (PST) MIME-Version: 1.0 In-Reply-To: <3a54074b-2517-472b-9fcc-50348933a959@googlegroups.com> References: <3a54074b-2517-472b-9fcc-50348933a959@googlegroups.com> From: Ian Kelly Date: Tue, 24 Feb 2015 16:16:57 -0700 Subject: Re: strip bug? To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1424819861 news.xs4all.nl 2835 [2001:888:2000:d::a6]:59934 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:86355 On Tue, Feb 24, 2015 at 4:05 PM, wrote: >>>> 'http://xthunder'.strip('http://') > 'xthunder' >>>> 'http://thunder'.strip('http://') > 'under' >>>> This removes all leading and trailing occurrences of the characters in the string 'http://', not the exact substring 'http://'. For that, use either the str.replace method or slicing. > I could understand backslash but forward slash? I don't understand the question.