2014-01-31 01:16:47 -05:00
|
|
|
print("".strip())
|
|
|
|
print(" \t\n\r\v\f".strip())
|
|
|
|
print(" T E S T".strip())
|
|
|
|
print("abcabc".strip("ce"))
|
|
|
|
print("aaa".strip("b"))
|
|
|
|
print("abc efg ".strip("g a"))
|
2014-04-25 23:20:08 -04:00
|
|
|
|
|
|
|
print(' spacious '.lstrip())
|
|
|
|
print('www.example.com'.lstrip('cmowz.'))
|
|
|
|
|
|
|
|
print(' spacious '.rstrip())
|
|
|
|
print('mississippi'.rstrip('ipz'))
|
2014-05-11 06:17:29 -04:00
|
|
|
|
|
|
|
print(b'mississippi'.rstrip(b'ipz'))
|
|
|
|
try:
|
|
|
|
print(b'mississippi'.rstrip('ipz'))
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|
|
|
|
try:
|
|
|
|
print('mississippi'.rstrip(b'ipz'))
|
|
|
|
except TypeError:
|
|
|
|
print("TypeError")
|