Results for “format”
Small, practical examples. Search by task or narrow things down below.
Read a field from container metadata
Use an inspect template for stable machine-readable output.
inspect✓ Tested
Read a tab-separated table
PowerShell: ConvertFrom-Csv accepts an explicit delimiter instead of requiring comma-separated input.
PowerShell✓ Tested
Read a value from a trusted XML document
PowerShell: The XML adapter exposes a small document’s elements and attributes through named properties.
PowerShell✓ Tested
Read an optional JSON property safely
C#: Use TryGetProperty instead of throwing when an optional property is absent.
C#✓ Tested
Read JSON into a hashtable
PowerShell: AsHashtable produces dictionary-style results for keys that are data rather than fixed property names.
PowerShell✓ Tested
Read values until a condition changes
Read values until a condition changes in a complete Rust program using the standard library.
Rust✓ Tested
Remove adjacent duplicates from a sorted array
C: Compact equal neighbors with a write index after sorting or otherwise establishing order.
C✓ Tested
Remove duplicate records by a selected key
C#: DistinctBy keeps the first record for each key in encounter order.
C#✓ Tested
Remove one array element and close the gap
C: memmove handles the overlap while the logical length shrinks by one.
C✓ Tested
Repeat text a fixed number of times
Java: Use String.repeat with a nonnegative repetition count.
Java✓ Tested
Rotate a nonempty array left by one element
C: Save the first item before shifting the remaining elements.
C✓ Tested
Search a sorted array with bsearch
C: The search uses the same ordering comparator as the sorted input.
C✓ Tested