string.find first before location

Gary Wessle phddas at yahoo.com
Tue May 2 01:49:03 EDT 2006


Hi

I have a string like this

text = "abc abc and Here and there"
I want to grab the first "abc" before "Here"

import string
string.find(text, "Here") # <type int>

I am having a problem with the next step.

thanks



More information about the Python-list mailing list