This article example tells the method of splitting strings and putting the divided data into an array. Share it for your reference. The specific implementation method is as follows:
var splitArray = new Array(); var string="Pacific Ocean, Atlantic Ocean, Indian Ocean, Arctic Ocean"; var regex = /、/; splitArray=(regex); for(i=0; i < ; i++){ (splitArray[i] + "<br>"); }
I hope this article will be helpful to everyone's JavaScript programming.