Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

split strings

str1 = "1 3 5 7 9"
list1 = str1.split()
map_object = map(int, list1)//Here we can turn the string into an int list

listofint = list(map_object)
print(listofint)
#result is [1, 3, 5, 7, 9]
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #split #strings
ADD COMMENT
Topic
Name
6+3 =