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]
const str = 'The quick brown fox jumps over the lazy dog.';
const words = str.split(' ');
console.log(words[3]);
// expected output: "fox"
const chars = str.split('');
console.log(chars[8]);
// expected output: "k"
const strCopy = str.split();
console.log(strCopy);
// expected output: Array ["The quick brown fox jumps over the lazy dog."]
class Main
{
// Iterate over the characters of a string
public static void main(String[] args)
{
String s = "Techie Delight";
String[] arr = s.split("");
for (String ch: arr) {
System.out.print(ch);
}
}
}