strip()

All String methods


Youtube Live session on Tkinter

strip(): Removes space or chars from left & right side of the string
By default strip() will remove space from left(leading) and right(trailing) of the string, we can also specify chars to be removed
my_str='  Plus2net    '
output=my_str.strip()
print(output)

my_str='*****plus2net**'
output=my_str.strip('*')
print(output) # removes * from both sides

my_str='*#*# plus2net *#*#'
output=my_str.strip('*# ')
print(output) # removes * ,# and space from both sides 
Output is here
plus2net
plus2net
plus2net
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