rstrip()

All String methods

By default rstrip() will remove space from right of the string, we can also specify chars to be removed
my_str='Plus2net    '
output=my_str.rstrip()
print(output)

my_str='plus2net**'
output=my_str.rstrip('*')
print(output) # removes * from right

my_str='plus2net *#*#'
output=my_str.rstrip('*#')
print(output) # removes all right 
Output is here
plus2net
plus2net
plus2net
my_str='Plus2net'
output=my_str.rstrip('et')
print(output)
Output
Plus2n
All String methods


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-2021 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer