FIND YOUR NEXT FEW LINES

Results for “Array traversal & selection”

Small, practical examples. Search by task or narrow things down below.

228 snippets foundClear filters
PowerShellGetting Started

Count array elements

PowerShell: Count array elements using PowerShell 7.

PowerShell✓ Tested
Bash ScriptsArray operations

Count the elements in an array

Bash Scripts: The array length form counts assigned elements, not characters in the first value.

Bash Scripts✓ Tested
RustGetting Started

Create a fixed-size array

Create a fixed-size array in a complete Rust program using the standard library.

Rust✓ Tested
PowerShellGetting Started

Create an array of text values

PowerShell: Create an array of text values using PowerShell 7.

PowerShell✓ Tested
GoGetting Started

Declare a fixed-size array

Declare a fixed-size array using a complete Go program with explicit sample inputs.

Go✓ Tested
C#JSON & binary formats

Enumerate the items of a JSON array

C#: Dispose JsonDocument after reading its elements.

C#✓ Tested
SQLiteJSON data

Expand a JSON array into rows

Iterate array elements using a table-valued function.

json_each✓ Tested
PostgresJSON & arrays

Expand an array into rows

Use WITH ORDINALITY to retain original element order.

unnest✓ Tested
CArray transformations

Filter an array in place with a write index

C: Only retained values advance the write position.

C✓ Tested
TypeScriptCollections & records

Filter and transform an array

Keep active objects and extract their names.

filter✓ Tested
CArrays

Find an array element

Use a bounded linear search over a C array.

C✓ Tested
PowerShellArray operations

Find the index of an array item

PowerShell: Array.IndexOf returns -1 when the requested item is absent.

PowerShell✓ Tested