Results for “only”
Small, practical examples. Search by task or narrow things down below.
Filter an array in place with a write index
C: Only retained values advance the write position.
C✓ Tested
Filter even numbers
Use LINQ Where to keep even C# values.
C#✓ Tested
Filter even numbers
Use a Java stream to collect only even values.
Java✓ Tested
Filter even numbers
Create a JavaScript array containing only even values.
JavaScript✓ Tested
Filter history by its author identity
Git: The author filter selects commits by their recorded author metadata.
Git✓ Tested
Filter values into a new slice
Filter values into a new slice using a complete Go program with explicit sample inputs.
Go✓ Tested
Find a commit that changed the count of a text string
Git: The pickaxe -S option finds commits that add or remove occurrences of a literal string.
Git✓ Tested
Find a matching item with a fallback
C#: Use the FirstOrDefault overload with an explicit default value.
C#✓ Tested
Find an item’s index
Find an item’s index using a complete Go program with explicit sample inputs.
Go✓ Tested
Find branches that contain a selected commit
Git: branch --contains limits the list to branches whose histories include the chosen revision.
Git✓ Tested
Find common set members
Find common set members in a complete Rust program using the standard library.
Rust✓ Tested
Find descendants
Select only matching descendants of a jQuery container.
jQuery✓ Tested