The usage of split (meaning to split a long string into multiple strings and put them in an array)

: Split a long string into multiple strings and put them in the array, so that you can use which string in the array can be used

  例:insertTime = "2015-02-10 12:00:00";

         var strsp=insertTime.split(" "); //Split insertTime into multiple strings

         strsp= 0: "2015-02-10" //strsp is an array at this time, which contains multiple strings in insertTime 1: "12:00:00"

         length: 2

         var time=strsp[0]+" "+insertHour+":00"; //If you want to use the first value in the array, just subscript it directly


 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326173101&siteId=291194637