Answers for "python break down string"

24

split string python

file='/home/folder/subfolder/my_file.txt'
file_name=file.split('/')[-1].split('.')[0]
Posted by: Guest on April-01-2020
0

break line in string python

myString = '1X2X3X'
print (myString.replace ('X', 'Xn'))
Posted by: Guest on December-17-2020

Python Answers by Framework

Browse Popular Code Answers by Language