Logo

Programming-Idioms

History of Idiom 7 > diff from v75 to v76

Edit summary for version 76 by EvilGenius:
New VB implementation by user [EvilGenius]

Version 75

2019-09-26, 19:42:07

Version 76

2019-09-27, 23:24:32

Idiom #7 Iterate over list indexes and values

Print each index i with its value x from an array-like collection items

Idiom #7 Iterate over list indexes and values

Print each index i with its value x from an array-like collection items

Extra Keywords
traverse traversal
Extra Keywords
traverse traversal
Code
Dim ItemList As New List(Of String)(New String() {"one", "two", "three"})
For x = 0 To ItemList.Count - 1
    Console.WriteLine(x & " " & ItemList(x))
Next