FIND YOUR NEXT FEW LINES

Results for “Collections & styling”

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

88 snippets foundClear filters
TypeScriptObject behavior & collections

Remove a Map entry and detect whether it existed

TypeScript: Map.delete returns true only when an entry was present.

TypeScript✓ Tested
GoSlices & collections

Remove a slice range

Remove a slice range using a complete Go program with explicit sample inputs.

Go✓ Tested
C#Collections & data structures

Remove matching items from a mutable list

C#: List.RemoveAll returns how many items it removed.

C#✓ Tested
GoSlices & collections

Reverse slice order

Reverse slice order using a complete Go program with explicit sample inputs.

Go✓ Tested
C#Collections & data structures

Search a sorted array efficiently

C#: Array.BinarySearch requires an array sorted with the same comparison rules.

C#✓ Tested
GoSlices & collections

Sort integers in place

Sort integers in place using a complete Go program with explicit sample inputs.

Go✓ Tested
C#Collections & data structures

Use a last-in first-out stack

C#: Stack is useful for reversible traversal and other nested operations.

C#✓ Tested
C#Collections & data structures

Use case-insensitive dictionary keys

C#: Choose an ordinal comparer when case-insensitive keys represent identifiers.

C#✓ Tested
PowerShellCollections & objects

Count items by group

Group repeated values and report each count.

Group-Object✓ Tested
PythonCollections

Count occurrences in a list

Count how often each value appears using Counter from the standard library.

count✓ Tested
JavaCollections

Count word frequencies

Use Map.merge to count repeated words in Java.

Java✓ Tested
C++Collections

Count word frequencies

Accumulate word counts in an ordered C++ map.

C++✓ Tested