-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrings.py
More file actions
26 lines (24 loc) · 918 Bytes
/
Copy pathstrings.py
File metadata and controls
26 lines (24 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
value = "aLtErNaTe is tHe bEst"
print("given string:", value)
print("lower():", value.lower())
print("upper():", value.upper())
print("title():", value.title())
print("swapcase():", value.swapcase())
print("capitalize():", value.capitalize())
print("casefold():", value.casefold())
# String Validation Methods
value = "aLtErNaTe is tHe bEst"
print("given string:", value)
print("isalnum():", value.isalnum())
print("isalpha():", value.isalpha())
print("isdecimal():", value.isdecimal())
print("isdigit():", value.isdigit())
print("isidentifier():", value.isidentifier())
print("islower():", value.islower())
print("isnumeric():", value.isnumeric())
print("isspace():", value.isspace())
print("istitle():", value.istitle())
print("isupper():", value.isupper())
print("join():", "-".join(value))
print("ljust():", value.ljust(30, "*"))
print("split():", "this is a string created for splinting into words".split(" "))