extract text from a string

Grant Edwards grante at visi.com
Thu Nov 9 11:14:00 EST 2006


On 2006-11-09, boris.smirnov at gmail.com <boris.smirnov at gmail.com> wrote:
> Hallo all,
>
> I have tried for a couple of hours to solve my problem with re but I
> have no success.
>
> I have a string containing: "+abc_cde.fgh_jkl\n" and what I need to
> become is "abc_cde.fgh_jkl".  Could anybody be so kind and write me a
> code of how to extract this text from that string?

>>> s = "+abc_cde.fgh_jkl\n"
>>> s[1:-1]
'abc_cde.fgh_jkl'

-- 
Grant Edwards                   grante             Yow!  ... I think I'm
                                  at               having an overnight
                               visi.com            sensation right now!!



More information about the Python-list mailing list