Answers for "split ()"

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

split string

String[] result = "this is a test".split("\s");
     for (int x=0; x<result.length; x++)
         System.out.println(result[x]);
Posted by: Guest on June-11-2021

Python Answers by Framework

Browse Popular Code Answers by Language