Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #86355

Re: strip bug?

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 <ian.g.kelly@gmail.com>
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 <ian.g.kelly@gmail.com>
Date Tue, 24 Feb 2015 16:16:57 -0700
Subject Re: strip bug?
To Python <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.19153.1424819861.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Tue, Feb 24, 2015 at 4:05 PM,  <baykiwi@gmail.com> 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.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

strip bug? baykiwi@gmail.com - 2015-02-24 15:05 -0800
  Re: strip bug? Eduardo <xcesar@gmail.com> - 2015-02-24 15:15 -0800
  Re: strip bug? Ian Kelly <ian.g.kelly@gmail.com> - 2015-02-24 16:16 -0700
  Re: strip bug? Irmen de Jong <irmen.NOSPAM@xs4all.nl> - 2015-02-25 00:19 +0100
  Re: strip bug? Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2015-02-25 00:25 +0100
  Re: strip bug? Chris Kaynor <ckaynor@zindagigames.com> - 2015-02-24 15:22 -0800
  Re: strip bug? Rustom Mody <rustompmody@gmail.com> - 2015-02-25 03:03 -0800
  Re: strip bug? babyG <bintadoma20@yahoo.com> - 2015-02-27 04:18 -0600

csiph-web