FIND YOUR NEXT FEW LINES

Results for “format”

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

650 snippets foundClear filters
JavaText validation & formatting

Extract text between known positions

Java: Java substring uses a start-inclusive, end-exclusive range of UTF-16 indices.

Java✓ Tested
CArray transformations

Filter an array in place with a write index

C: Only retained values advance the write position.

C✓ Tested
C#LINQ transformations

Find a matching item with a fallback

C#: Use the FirstOrDefault overload with an explicit default value.

C#✓ Tested
JavaStream transformations

Find the first matching stream value

Java: Use findFirst and an explicit default for an empty result.

Java✓ Tested
RustIterators & transformations

Find the first matching value

Find the first matching value in a complete Rust program using the standard library.

Rust✓ Tested
CArray transformations

Find the smallest value in a nonempty array

C: Initialize from the first element instead of assuming a numeric sentinel.

C✓ Tested
JavaStream transformations

Flatten nested collections

Java: Use flatMap to concatenate nested Java lists into one stream.

Java✓ Tested
RustIterators & transformations

Flatten nested collections

Flatten nested collections in a complete Rust program using the standard library.

Rust✓ Tested
C#LINQ transformations

Flatten nested collections with SelectMany

C#: Concatenate the items from several sequences into one sequence.

C#✓ Tested
JavaStream transformations

Group strings by their length

Java: Choose a TreeMap supplier when group keys must have deterministic order.

Java✓ Tested
PowerShellStructured formats & encodings

Handle a malformed JSON document

PowerShell: ConvertFrom-Json reports a terminating conversion error under the selected error preference.

PowerShell✓ Tested
C#JSON & binary formats

Handle malformed JSON

C#: Catch JsonException for malformed JSON without swallowing unrelated failures.

C#✓ Tested