Results for “list”
Small, practical examples. Search by task or narrow things down below.
Find matching files recursively
Python: Use rglob and sorted relative paths for a reproducible recursive file listing.
Python✓ Tested
Find the first matching value with a fallback
Python: Pass a generator and default to next to avoid building an intermediate list.
Python✓ Tested
Flatten nested collections
Java: Use flatMap to concatenate nested Java lists into one stream.
Java✓ Tested
Identify the current page in a breadcrumb
HTML: An ordered breadcrumb list sits inside a named navigation region, with aria-current on the current location.
HTML✓ Tested
Ignore generated files
Exclude build output from untracked-file listings.
gitignore✓ Tested
Insert a value while preserving sorted order
Python: Use insort on an already sorted list; insertion still shifts later list elements.
Python✓ Tested
Join strings with a separator
Combine a list of strings into one readable string with a separator between each item.
string✓ Tested
Label rows with CASE
Derive a readable label from a condition.
CASE✓ Tested
Remove duplicate values
Preserve encounter order while removing repeated Java list values.
Java✓ Tested
Remove matching elements
Remove selected list items from the DOM with jQuery.
jQuery✓ Tested
Select specific columns
Read only the fields a result needs.
SELECT✓ Tested
Sort and deduplicate values
Produce an ordered list without duplicates.
Sort-Object✓ Tested