How to declare an array using spaces instead of ,? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to declare an array using spaces instead of ,?

13th Jan 2020, 6:15 AM
Entroper
Entroper - avatar
3 Answers
+ 2
Entroper In Python you have split() method for strings. "50 10 60".split() would split the string to list ["50", "10", "60"] (the numbers are still strings), maybe JavaScript has an equivalent string method.
13th Jan 2020, 6:43 AM
Seb TheS
Seb TheS - avatar
+ 1
Spaces? Do you mean you want to separate items with spaces or treat items as spaces?
13th Jan 2020, 6:33 AM
Seb TheS
Seb TheS - avatar
0
Seb TheS seperate!
13th Jan 2020, 6:36 AM
Entroper
Entroper - avatar