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


Groups > comp.lang.python > #22050 > unrolled thread

Re: Odd strip behavior

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-03-22 14:06 -0600
Last post2012-03-22 14:06 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#22050 — Re: Odd strip behavior

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-03-22 14:06 -0600
SubjectRe: Odd strip behavior
Message-ID<mailman.909.1332446814.3037.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web