Re: search backward

From: Aaron Bingham (bingham_at_cenix-bioscience.com)
Date: 01/04/05


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
--------------------------------------------------------------------


Relevant Pages

  • Re: _ecvt, _gcvt and _fcvt problem
    ... The question is...Do you understand what Robert ... >>>But I have problem about conversion double to string. ... >> problem I strongly recommend taking some time to learn about UNICODE. ... >> please indicate which newsgroup and message). ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: User Define Array Data Type - Subscript out of range
    ... Works just DANDY, Robert! ... strDataType As String ... ' Load Array ...
    (microsoft.public.access.modulesdaovba)
  • Re: String.each
    ... On 3/3/07, Robert Klemme wrote: ... >>> each character of a string and then processes it using a block. ... String's enumeration is a bit weird and inconsistent. ... String as array of lines does have it's uses at times but I wonder ...
    (comp.lang.ruby)
  • Re: Improving Adas image - Was: 7E7 Flight Controls Electronics
    ... Robert I. Eachus wrote: ... function Imagereturn String is ... type Color is (Red, Orange, Yellow, Blue, Green, Violet, ...
    (comp.lang.ada)
  • Re: send problems linux
    ... On 2003-10-29, Robert wrote: ... do 'send' your buffer is copied into system buffer. ... 'send' then your new string is appended to the previous string. ... *stream* you read merged line. ...
    (comp.unix.programmer)