On Sat, 2008-06-28 at 01:17 -0700, Jarred Bishop wrote:
> hello, I'm trying to get the index of the last backslash from a string
> in python.
> 
> The problem I have is that the backslash before the last quotation
> mark, cancels out the quote.
> 
> eg: string.rfind("\") will error, because technically the string isn't
> closed (as a backslash before a quote escapes it).

Escape the backslash. :-)

        my_string.rfind("\\")

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to