summaryrefslogtreecommitdiffstatshomepage
path: root/tests/basics/string_strip.py
blob: 4684c2a2480d9502f7d35fa1cee762a0759ea12e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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"))

print('   spacious   '.lstrip())
print('www.example.com'.lstrip('cmowz.'))

print('   spacious   '.rstrip())
print('mississippi'.rstrip('ipz'))

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")