Home > Article > Web Front-end > Split usage methods and techniques in Javascript_Basic knowledge
I rarely used the Split method before, but I found some information today.
Usage method: myArray=string.split("|")
Explanation: "|" is the cutting characteristic character, string is the string to be cut, myArray is the cutting result (stored in the array), use method myArray [n], n=myArray.length.
At first, I was thinking about how to get the maximum subscript of myArray using asp thinking. It was definitely not Ubound(myArray). I searched for a long time but couldn’t find it. Finally, I found out. In fact, in Javascript, arrays have a length attribute. myArray.length-1 is the maximum subscript of the myArray array. It is very simple. It is easy to think of it, but difficult to think of it.
Let’s look at an example of using split: using javascript to obtain address bar parameters.