FIND YOUR NEXT FEW LINES

Results for “list”

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

135 snippets foundClear filters
PythonFile operations & archives

Find matching files recursively

Python: Use rglob and sorted relative paths for a reproducible recursive file listing.

Python✓ Tested
PythonIteration & sequences

Find the first matching value with a fallback

Python: Pass a generator and default to next to avoid building an intermediate list.

Python✓ Tested
JavaStream transformations

Flatten nested collections

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

Java✓ Tested
HTMLAccessible structure

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
GitWorking tree & staging

Ignore generated files

Exclude build output from untracked-file listings.

gitignore✓ Tested
PythonNumbers & calculations

Insert a value while preserving sorted order

Python: Use insort on an already sorted list; insertion still shifts later list elements.

Python✓ Tested
PythonStrings & dates

Join strings with a separator

Combine a list of strings into one readable string with a separator between each item.

string✓ Tested
SQLExpressions & aggregates

Label rows with CASE

Derive a readable label from a condition.

CASE✓ Tested
JavaCollections

Remove duplicate values

Preserve encounter order while removing repeated Java list values.

Java✓ Tested
jQueryDOM & classes

Remove matching elements

Remove selected list items from the DOM with jQuery.

jQuery✓ Tested
SQLSelect & filter

Select specific columns

Read only the fields a result needs.

SELECT✓ Tested
PowerShellCollections & objects

Sort and deduplicate values

Produce an ordered list without duplicates.

Sort-Object✓ Tested