Commit 0ed8c689 authored by Ezio Melotti's avatar Ezio Melotti

Add a note to the str.find doc to suggest the use of the "in" operator.

parent 262c5827
......@@ -883,6 +883,15 @@ functions based on regular expressions.
*start* and *end* are interpreted as in slice notation. Return ``-1`` if
*sub* is not found.
.. note::
The :meth:`~str.find` method should be used only if you need to know the
position of *sub*. To check if *sub* is a substring or not, use the
:keyword:`in` operator::
>>> 'Py' in 'Python'
True
.. method:: str.format(*args, **kwargs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment