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


Groups > comp.lang.python > #22050

Re: Odd strip behavior

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.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.013
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'removes': 0.07; "'this": 0.09; 'trailing': 0.09; "'')": 0.16; '1:48': 0.16; 'subject:behavior': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.18; 'cheers,': 0.20; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.26; 'message-id:@mail.gmail.com': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; '22,': 0.30; 'thu,': 0.32; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:209': 0.39; 'leading': 0.62; 'brown': 0.80
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 :cc:content-type; bh=5wKw6p60k8ekLu8EgnE5BIMYxMkqO7bS2jBqasi/iJ4=; b=gLUZSqbHxyE0llr09KZisKXJu3D/8+Dx2Gw3e+opOoXVmTngl1Qlwulp/XbZleVWDF bql2IMMPwIx/W092a3LldBqd/FjhXnDmmnNB+oRLaq7VTYvdSqUbqgZjL0sOv3/cveGV RjnbaPNPR8ZEb+WRcP5YnBjT14i6tSebFrY69mOJBlnqRJM+B5PDOmPppXfgujEswKwG CCswcz87tZRbIxF4cVfU4Q8kArmwLoWTHEMS9pCTMIlPPwCgYBtx9YQz8N7ceargEQic 8ZC1MG1TKPj+CAOrVAF2OLXMy0XtXwLJ1n6VWHzs76JWhXbZC2b8Ztz53gJzE/IombR4 MIuw==
MIME-Version 1.0
In-Reply-To <5B2CBFB0-DC2D-47E1-978F-59E47EB3A757@gmail.com>
References <5B2CBFB0-DC2D-47E1-978F-59E47EB3A757@gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 22 Mar 2012 14:06:21 -0600
Subject Re: Odd strip behavior
To Rodrick Brown <rodrick.brown@gmail.com>
Content-Type text/plain; charset=ISO-8859-1
Cc "python-list@python.org" <python-list@python.org>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.909.1332446814.3037.python-list@python.org> (permalink)
Lines 10
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1332446814 news.xs4all.nl 6953 [2001:888:2000:d::a6]:49477
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:22050

Show key headers only | View raw


On Thu, Mar 22, 2012 at 1:48 PM, Rodrick Brown <rodrick.brown@gmail.com> wrote:
> Why wasnt the t removed ?

Because str.strip() only removes leading or trailing characters.  If
you want to remove all the t's, use str.replace:

'this is a test'.replace('t', '')

Cheers,
Ian

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


Thread

Re: Odd strip behavior Ian Kelly <ian.g.kelly@gmail.com> - 2012-03-22 14:06 -0600

csiph-web