PyDocs

Nav

Python Runtime Services

str.startswith

builtins

method of str
  • str.startswith(prefix[, start[, end]])
Return True if the string starts with the specified prefix, False otherwise.

prefix
  A string or a tuple of strings to try.
start
  Optional start position. Default: start of the string.
end
  Optional stop position. Default: end of the string.
1 Example
>>> 'Python'.startswith('Py')
True
>>> 'a tuple of prefixes'.startswith(('at', 'a'))
True
>>> 'Python is amazing'.startswith('is', 7)
True
from the Python docs
See Also
No see-alsos for builtins/str.startswith
0 Notes
No notes for str.startswith