rstrip()

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



plus2net.com



Post your comments , suggestion , error , requirements etc here




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