Re: search backward

2005-01-04 Thread Steven Bethard
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? How about str.rfind? py> s = 'abc:def:abc' py> s.rfind('abc') 8 Steve -- http

Re: search backward

2005-01-04 Thread Aaron Bingham
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")

search backward

2005-01-04 Thread Robert
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? Thanks, Robert -- http://mail.python.org/mailman/listinfo/python-list