On May 11, 10:45 am, Tim Golden <[EMAIL PROTECTED]> wrote:
> HMS Surprise wrote:
> > I suppose a one liner would look better, but I am alway leery of these
> > things 'breaking'.
>
> > t = s.split('">')[-1].split('<')[0]
> > s ='G132153'
>
> Only if you're competing in an obscurity competition ;)
>
HMS Surprise wrote:
> I suppose a one liner would look better, but I am alway leery of these
> things 'breaking'.
>
> t = s.split('">')[-1].split('<')[0]
> s ='G132153'
Only if you're competing in an obscurity competition ;)
If you're really confined to built-ins (ie you can't import
a single mo
I suppose a one liner would look better, but I am alway leery of these
things 'breaking'.
t = s.split('">')[-1].split('<')[0]
s ='G132153'
jh
--
http://mail.python.org/mailman/listinfo/python-list
Greetings.
Given the string s below and using only python built-in capabilities,
I am trying to isolate the substring G132153. This string may have any
number of digits but the pieces around it will not change. I have
accomplished this with split but there must be a more elegant and
compact way t