let strs=readline().split(" ")//按空格分割读入的字符串,转成数组bcd let st="abcde"; let stArr=st.split("");//["a", "b", "c", "d", "e"] //把字符串串每个字符都分割出来
console.log(Array.from('foo')); // expected output: Array ["f", "o", "o"] console.log(Array.from([1, 2, 3], x => x + x)); // expected output: Array [2, 4, 6]
let str="abcde" [...str]//["a", "b", "c", "d", "e"]
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/203031.html原文链接:https://javaforall.net
