Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Vb

Idiom #19 Reverse a list

Reverse the order of the elements of the list x.
This may reverse "in-place" and destroy the original ordering.

Dim ItemList As New List(Of String)(New String() {"one", "two", "three"})
ItemList.Reverse()
For Each item In ItemList
    Console.WriteLine(item)
Next
with Ada.Containers.Vectors;
use Ada.Containers;
X.Reverse_Elements;

New implementation...
< >
programming-idioms.org