Split
the Join method corresponding to the array (join-> splits the arrays into strings according to the specified delimiter)
splits a string into each item in the array by the specified delimiter
var ary = [12, 23, 34, 45];
var str = ary.join ("+");
console.log (str);//-> "12+23+34+45"
var newary = str.split ("+");
Console.log (newary);//->["12", "23", "34", "45"]
var str = "2016-1-2 13:1:23";
//-> "January 02, 2016 13:01 23 sec"
var ary = Str.split ("");//->["2016-1-2", "13:1:23"]
var leftary = ary[0].split ("-");//-> "2016-1-2"->["," 1 "," 2 "]
var rightary = Ary[1].split (":");//-> "13:1:23"->["All", "1", "[]"]
var time = leftary[0] + "year" + Addzero (leftary[1]) + "month" + Addzero (leftary[2]) + "Day" + Addzero (rightary[0]) + "when" + Addzero (rightary[1]) + "min" + Addzero (rightary[2]) + "seconds";
Console.log (time);
function Addzero (value) {
if (value <) {
value = "0" + value;
}
return value;
//return value < 10? "0" + value:value;
}
Format Time string