-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, September 11, 2008 8:54 AM
To: python-list@python.org
Subject: Re: removing text string
Ahmed, Shakir:
> Actually the number I am getting it is from slicing from a l
Ahmed, Shakir:
> Actually the number I am getting it is from slicing from a long text
> line. I need to slice 10 characters from that line but no string only
> numeric numbers. When I am slicing 10 characters those A, c, O is coming
> at the end.
It's better to avoid Regular expressions when they
]
[mailto:[EMAIL PROTECTED] On Behalf Of
Dennis Lee Bieber
Sent: Wednesday, September 10, 2008 3:45 PM
To: python-list@python.org
Subject: Re: removing text string
On Wed, 10 Sep 2008 11:22:16 -0400, "Ahmed, Shakir" <[EMAIL PROTECTED]>
declaimed the following in comp.lang.python:
> I
You just want to drop the last two characters? Slice it.
>>> s = "080829-7_A"[:-2]
>>> print s
080829-7
- Adam
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
Behalf
> Of Ahmed, Shakir
> Sent: Wednesday, September 10, 2008 10:22 AM
> To: python-list@python.
On Wed, 10 Sep 2008 11:22:16 -0400, Ahmed, Shakir wrote:
> I need to remove text string from the list of the numbers mentioned
> below:
>
> 080829-7_A
> 070529-5_c
> 080824-7_O
> 070405_6_p
>
> The output will be : 080829-7
> 070529-5
>080824-7
>