Python String find() MethodPython find() method finds substring in the whole string and returns index of the first match. It returns -1 if substring does not match. SignatureParameters
Return TypeIf found it returns index of the substring, otherwise -1. Let's see some examples to understand the find() method. Python String find() Method Example 1An example of simple find method which takes only single parameter (a substring). Output: 11 Python String find() Method Example 2It returns -1 if not found any match, see the example. Output: -1 Python String find() Method Example 3Let's specify other parameters too and makes search more customize. Output: 8 -1 Python String find() Method Example 4Output: 8 24
Next TopicPython Strings
|
JavaTpoint offers too many high quality services. Mail us on [email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected]
Duration: 1 week to 2 week