var string = "Split me into an array"; var array = [];
array = string.split(" "); // 把字符串变成数组, 按照空格的方式改变 // 结果为["Split","me","into","an","array"]
array = string.split("i"); // 结果为["Spl","t me ","nto an array"]
var string = "Split me into an array"; var array = [];
array = string.split(" "); // 把字符串变成数组, 按照空格的方式改变 // 结果为["Split","me","into","an","array"]
array = string.split("i"); // 结果为["Spl","t me ","nto an array"]