python slit code example
Example 1: split string python
file='/home/folder/subfolder/my_file.txt'
file_name=file.split('/')[-1].split('.')[0]
Example 2: python slit
text= 'Love thy neighbor'
# splits at space
print(text.split())
grocery = 'Milk, Chicken, Bread'
# splits at ','
print(grocery.split(', '))
# Splitting at ':'
print(grocery.split(':'))