startswith()

All String methods


Youtube Live session on Tkinter

startswith():Check if the string starts with specified string or not
Returns True if the main string starts with specified search string, otherwise returns False
main_string.startswith(search_string, start, end)
search_string
Required, String to be searched to check to match starting of the main string.
start
Optional, Starting position of search , by default it is from 0 or starting position of string
end
Optional , ending position of search, by default it is end of the string.
This is case sensitive search.
my_str='Welcome to plus2net.com Python section'
output=my_str.startswith('Wel') 
print(output) # output is True

my_str='Welcome to plus2net.com Python section'
output=my_str.startswith('co',3)
print(output) # output is True


my_str='Welcome to plus2net.com Python section'
output=my_str.startswith('co',20,24)
print(output) # output is True
Output is here
True
True
True
All String methods


Subscribe to our YouTube Channel here


Subscribe

* indicates required
Subscribe to plus2net

    plus2net.com



    Post your comments , suggestion , error , requirements etc here





    Python Video Tutorials
    Python SQLite Video Tutorials
    Python MySQL Video Tutorials
    Python Tkinter Video Tutorials
    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2024 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer