FIND YOUR NEXT FEW LINES

Results for “transform”

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

72 snippets foundClear filters
JavaStream transformations

Calculate several numeric stream statistics

Java: Use summaryStatistics to calculate count, sum, minimum, maximum, and average in one pass.

Java✓ Tested
JavaStream transformations

Check any and all stream elements

Java: Use short-circuiting match operations for predicates over a Java collection.

Java✓ Tested
Linux CommandsTransforming text

Collapse repeated spaces

Linux Commands: Use tr -s when repeated occurrences of a character should become one.

Linux Commands✓ Tested
Linux CommandsTransforming text

Convert tab stops to spaces

Linux Commands: Use expand with a fixed tab width when preparing plain-text alignment.

Linux Commands✓ Tested
C#LINQ transformations

Create a reusable one-to-many lookup

C#: ToLookup groups values by key and returns an empty sequence for an unknown key.

C#✓ Tested
Linux CommandsTransforming text

Extract a delimited text column

Linux Commands: Use cut for simple unquoted delimiter-separated text.

Linux Commands✓ 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