Http://www.asp888.net bean curd technology station
Powerful Array Function (called by asp + program Array Function)
Array initialization: we use the new keyword to create an ArrayList object.
Assign a value to the item of the array. We only need to use the ArrayList method to Add the item.
Get the array size: count Method
Let's take a look at the example below.
<%
Dim arr as new ArrayList
Arr. Add (1)
Arr. Add (3)
Arr. add (2)
Arr. add (445)
Arr. add (223)
Arr. add (112)
Response. write (cStr (arr. count ))
%>
The returned value of this program is 6.
If we want him to display all the data, we should
<%
For I = 0 to Arr. count-1
Response. write (arr. item (I ))
Next
%>
After executing this program, we will find that the data is not sorted and displayed. We can call the sort method
This array is a sorted array.
<%
Arr. sort ()
For I = 0 to Arr. count-1
Response. write (arr. item (I ))
Next
%>
Through these examples, we have found that in asp.net, we have a powerful array processing object.
The demonstration is only the tip of the iceberg about the powerful functions of this object. You can get more surprises by viewing the help of Vs7 beta1.