VB.NET Reverse array elemments

In this article we will learn how to reverse the the element of an Array.
  • 3475
 

Reverse array elements

In this we Reverse the string of an array . In this Example We have a string with element 1, 2, 3, 4, 5, 6, 7 and now we going to reverse it.

1.Open visual Studio

2.Create a project with console application with language VB.Net

3.Write the following code in the page

Module Tester
     Sub Main()
        Dim Values() As Integer = {1, 2, 3, 4, 5, 6, 7}
        Dim MyValues(7) As Integer
        Dim Prices() As Double = {25.5, 4.95, 33.4}
         Dim I As Integer

 
        For I = 0 To 6
            Console.Write(Values(I) & " ")
        Next
        Console.WriteLine()
        Values.Reverse(Values)
         For I = 0 To 6
            Console.Write(Values(I) & " ")
        Next
        Console.WriteLine()
        Console.Read()
    End Sub

End
Module

Outout of the Application

reverse.jpg

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.