Following are the Find and Replace methods in Python −
Sr.No. Method & Description1
Counts how many times sub occurs in string or in a substring of string if starting index beg and ending index end are given.
2
Determine if sub occurs in string or in a substring of string if starting index beg and ending index end are given returns index if found and -1 otherwise.
3
Same as find(), but raises an exception if str not found.
4
Replaces all occurrences of old in string with new or at most max occurrences if max given.
5
Same as find(), but search backwards in string.
6
Same as index(), but search backwards in string.
7
Determines if string or a substring of string (if starting index beg and ending index end are given) starts with substring sub; returns true if so and false otherwise.
8
Determines if string or a substring of string (if starting index beg and ending index end are given) ends with suffix; returns true if so and false otherwise.
python_string_methods.htm
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4