Have to try
jason at jorendorff.com
Sat Feb 16 23:07:31 EST 2002
Rick Hamilton writes:
> I want to search that string for the occurrence of a sub string.
> I have tried
It looks like you're using an extra-old version of Python,
because mystring.find(sub) really should work.
>>> x = "lovely spam, wonderful spam!"
So you must be using Python 1.6 or earlier. Try this.
>>> import string
>>> string.find(x, 'spam')
## Jason Orendorff http://www.jorendorff.com/
More information about the Python-list