Re: search backward
From: Aaron Bingham (bingham_at_cenix-bioscience.com)
Date: 01/04/05
- Next message: Mirko Zeibig: "python 3000 and removal of builtin callable"
- Previous message: Nick Coghlan: "Deferred expressions (was Re: Lambda as declarative idiom)"
- In reply to: Robert: "search backward"
- Next in thread: Steven Bethard: "Re: search backward"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 04 Jan 2005 10:37:34 +0100 To: Robert <vanduuren@gmail.com>
Robert wrote:
> I need to find the location of a short string in a long string. The
> problem however is that i need to search backward.
>
> Does anybody know how to search in reverse direction?
>>> "foofoo".find("foo")
0
>>> "foofoo".rfind("foo")
3
>>> "foofoo".index("foo")
0
>>> "foofoo".rindex("foo")
3
-- -------------------------------------------------------------------- Aaron Bingham Application Developer Cenix BioScience GmbH --------------------------------------------------------------------
- Next message: Mirko Zeibig: "python 3000 and removal of builtin callable"
- Previous message: Nick Coghlan: "Deferred expressions (was Re: Lambda as declarative idiom)"
- In reply to: Robert: "search backward"
- Next in thread: Steven Bethard: "Re: search backward"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|