Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is there a reverse index?
#1
i need the index of the first occurrence of in s (at or after index i) just like s.index(x,i) but in reverse. that is, equivalent to testing slices of s[i:i+len(x)] for a decrementing value of i. anyone know of such a method or function? this is for a str type though a general solution for any sequence type would be great.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
is there a reverse index? - by Skaperen - Jun-12-2019, 11:55 PM
RE: is there a reverse index? - by Clunk_Head - Jun-13-2019, 12:01 AM
RE: is there a reverse index? - by Skaperen - Jun-13-2019, 01:23 AM
RE: is there a reverse index? - by Clunk_Head - Jun-13-2019, 01:46 AM
RE: is there a reverse index? - by Skaperen - Jun-14-2019, 03:08 AM
RE: is there a reverse index? - by nilamo - Jun-14-2019, 09:08 PM
RE: is there a reverse index? - by Skaperen - Jun-14-2019, 11:47 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020