Check if String Ends with Substring using Python

endswith method

text = 'Hello world'
result = text.endswith('world')

print(result)

Leave a Comment

Cancel reply

Your email address will not be published.