strip()

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



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