Logo

Programming-Idioms

History of Idiom 7 > diff from v112 to v113

Edit summary for version 113 by zqwnvl:
New VB implementation by user [zqwnvl]

Version 112

2021-08-24, 03:45:42

Version 113

2021-08-24, 03:46:58

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

Variables
i,x,items
Variables
i,x,items
Extra Keywords
indices traverse traversal
Extra Keywords
indices traverse traversal
Imports
Imports System
Code
For i As Integer = 0 To items.Length - 1
    Dim x = items(i)
    Console.WriteLine($"Item {i} = {x}")
Next
Comments bubble
items is an array
Demo URL
https://sharplab.io/#gist:4cd27c28547179169e18e84a1a18728e