To find a string that starts with something(prefix), use the Python String startswith() function.

Python String startswith()

Python string startswith() is an inbuilt function that checks whether the string starts with a given prefix otherwise it returns False. It optionally restricting the matching with the given indices start and end. Python String startswith() returns true if found matching string otherwise false.

Syntax

str.startswith(prefix, beg=0,end=len(string));

#python #python string startswith

Python String Startswith: How to Check Start Character of String
2.20 GEEK