Peter Otten <[EMAIL PROTECTED]> writes:
> Gary Wessle wrote:
>
> > I have a string like this
> >
> > text = "abc abc and Here and there"
> > I want to grab the first "abc" before "Here"
> >
> > import string
> > string.find(text, "Here") # <type int>
> >
> > I am having a problem with the next step.
>
> These days str methods are preferred over the string module's functions.
>
> >>> text = "abc abc and Here and there"
> >>> here_pos = text.find("Here")
> >>> text.rfind("abc", 0, here_pos)
> 4
>
> Peter
and what about when python 3.0 is released and those depreciated
functions like find and rfind are not supported. is there another
solution which is more permanent?
--
http://mail.python.org/mailman/listinfo/python-list