Have to try
jason at jorendorff.com
Sun Feb 17 05:07:31 CET 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