
104
|
Chapter 7: The .NET Framework Class Library
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
Next counter
End Sub
The output is:
Unsorted:
9
8
12
4
5
Sorted:
4
5
8
9
12
Some of the more important methods of the Array class are shown in Table 7-2.
New in 2005. Beginning with the 2.0 release of the .NET Framework, System.
Array now includes features that support the new generics functionality,
including a wrapper for read-only, type-specific arrays. For information on using
generics, see Chapter 10.
The System.Math Class
The System.Math class includes a number of mathematical methods (such as trig-
onometric functions), as well as some more useful general numeric methods, such
as Max and Min. For instance, to determine the maximum of two values, use:
MsgBox("The maximum of 4 and 7 is " & Math.Max(4, 7))
Table 7-3 shows the members of the Math class.
Table 7-2. Some members of the System.Array class
Method Description
BinarySearch
Searches a sorted one-dimensional array for a value
IndexOf
Returns the location of the first occurrence of a particular value in a one-dimensional array
LastIndexOf
Returns the location of the last occurrence of a particular value in a one-dimensional array
Reverse
Reverses the order of the elements in a one-dimensional array or a portion of a one-dimen-
sional array
Sort
Sorts a one-dimensional array
Table 7-3. The members of ...