I) Length Property: Array.Length
II) Rank Property: Array.Rank
III) Array.Sort method: Array.Sort(myArray)
IV) Array.Reverse method: Array.Reverse(myArray)
V) Array.Resize method: It is used to change the size of an array. Because the array size is immutable (the size cannot be changed at run time), this method actually copies the elements of the array to another array and then renames the new array and discards the old one. This is a generic method, which means it can work with any array type.
For example, if you have an array named myArray initialized with three elements, we can extend its size to six elements by using the following statement:
Array.Resize<int>(ref myArray,6);
In this statement, <int> is the type argument. We can also use the following statement to extend the size to six:
Array.Resize(ref myArray,6);
Tuesday, March 16, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment