-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path08.string2.py
21 lines (19 loc) · 872 Bytes
/
08.string2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#08. Python Strings2
string = """
"8th_Day: Python Strings 2
\nThere are many functions to use with strings:
string.strip() => Deletes space from beginning or end of the string.
len(string) => Returns the length of a string
string.lower() => Returns the string in lower case
string.upper() => Returns the string in upper case
string.replace("old","new") => Replaces a string with another one"
string.split("x") => Splits the strings into substring if find x"
"""
print(string)
testString = " This Is A string..! "
print("strip() => " + testString.strip())
print("len() => " + str(len(testString)))
print("lower() => " + testString.lower())
print("upper() => " + testString.upper())
print("replace()=> " + testString.replace("A","My"))
print(testString.strip().split(" "))