forked from hussien89aa/PythonTutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.py
More file actions
24 lines (22 loc) · 640 Bytes
/
Copy pathstring.py
File metadata and controls
24 lines (22 loc) · 640 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
def main():
# string management
string = "hola CARLOS"
# conatenate
print(string+" como estas")
# replace
print(string.replace("hola", 'hi'))
# lower case
print(string.lower())
# upper case
print(string.upper())
# count
print(len(string))
# find get the position of charater
# this method retunr -1 is string don't exist
print(string.find("hola"))
#split
# transform string into array depending on the chain
print(string.split(' '))
#TODO: https://www.programiz.com/python-programming/methods/string FOR MORE INFORMATION
if __name__ == '__main__':
main()