Skip to Content
Programming Visual Basic .NET, Second Edition
book

Programming Visual Basic .NET, Second Edition

by Jesse Liberty
April 2003
Intermediate to advanced
560 pages
14h 4m
English
O'Reilly Media, Inc.
Content preview from Programming Visual Basic .NET, Second Edition

System.Array

VB.NET implements arrays with the class System.Array. The Array class has a number of useful methods. Table 9-1 shows a few of the more important methods and properties of the System.Array class.

Table 9-1.  Useful methods and properties of System.Array

Method or property

Description

Clear( )

Public shared method that sets a range of elements in the array to zero or to a null reference

Copy( )

Overloaded public shared method that copies a section of one array to another array

IndexOf( )

Overloaded public shared method that returns the index (offset) of the first instance of a value in a one-dimensional array

IsFixedSize

Public property that returns a value indicating whether the array has a fixed size

LastIndexOf( )

Overloaded public shared method that returns the index of the last instance of a value in a one-dimensional array

Length

Public property that returns the length of the array

Reverse( )

Overloaded public shared method that reverses the order of the elements in a one-dimensional array

Rank

Public property that returns the number of dimensions of the array

Sort( )

Overloaded public shared method that sorts the values in a one-dimensional array

The Array class’s shared methods, Reverse( ) and Sort( ), make manipulation of the objects within the array very easy. Note, however, that to reverse or sort the elements of the array, they must be of a type that implements the IComparable interface, described in Chapter 8. The ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Visual Basic .NET

Programming Visual Basic .NET

Dave Grundgeiger
VB.NET Language in a Nutshell, Second Edition

VB.NET Language in a Nutshell, Second Edition

Steven Roman PhD, Ron Petrusha, Paul Lomax

Publisher Resources

ISBN: 0596004389Supplemental ContentCatalog PageErrata