Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #22050 > unrolled thread
| Started by | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| First post | 2012-03-22 14:06 -0600 |
| Last post | 2012-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.
Re: Odd strip behavior Ian Kelly <ian.g.kelly@gmail.com> - 2012-03-22 14:06 -0600
| From | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| Date | 2012-03-22 14:06 -0600 |
| Subject | Re: 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
Back to top | Article view | comp.lang.python
csiph-web