It return True if  strings starts with specified prefix otherwise False. To determine whether strings starts with specified prefix we can use str.startswith. We can also mention start and end position.

Syntax of Str.startswith:

startswith(prefix, start, end) =>Bool(TRUE or FALSE)

prefix:prefix we want to search.

start: starting position of index

end: ending position of index

str.startswith in python
Str.startswith

As shown in image above it returns True When string starts with the given prefix ‘K’ else returns False.

By SC

One thought on “Str.startswith”

Leave a Reply

Your email address will not be published. Required fields are marked *