O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

Array.Reverse Method

Class

System.Array

Syntax

Array.Reverse(array[, startindex, endindex])
array (required; any array)

The array to be reversed

startIndex (optional; Integer)

The index at which to start the reversal process

endIndex (optional; Integer)

The index at which to end the reversal process

Return Value

None

Description

Reverses a portion of or all of the elements of an array

Example

Dim a(  ) As Integer = {1, 2, 3, 4, 5}
Dim i As Integer
array.Reverse(a, 1, 3)
For i = 0 To 4
    debug.Write(a(i))
Next

This code prints the sequence 14325, which is the original array 12345 with the middle section from index 1 to index 3 reversed.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required