FIND YOUR NEXT FEW LINES

Results for “then”

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

703 snippets foundClear filters
AngularLists & control flow

Remove a list item by identifier

Remove a list item by identifier with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
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
C++Containers & compound values

Remove a map entry and inspect the number removed

C++: erase by key reports whether a unique-key map contained the entry.

C++✓ Tested
RustStrings & Unicode

Remove a prefix only when it matches

Remove a prefix only when it matches in a complete Rust program using the standard library.

Rust✓ Tested
CStrings

Remove a trailing line ending

Use strcspn to terminate a C string at its first newline or carriage return.

C✓ Tested
CArray transformations

Remove adjacent duplicates from a sorted array

C: Compact equal neighbors with a write index after sorting or otherwise establishing order.

C✓ Tested
RustMaps & sets

Remove an entry and inspect its value

Remove an entry and inspect its value in a complete Rust program using the standard library.

Rust✓ Tested
RustVectors & slices

Remove and collect a vector range

Remove and collect a vector range in a complete Rust program using the standard library.

Rust✓ Tested
C#Collections

Remove duplicate values

Use LINQ Distinct and OrderBy for a sorted C# result.

C#✓ Tested
JavaCollections

Remove duplicate values

Preserve encounter order while removing repeated Java list values.

Java✓ Tested
TypeScriptCollections & records

Remove duplicate values with a Set

Keep the first occurrence order while deduplicating.

Set✓ Tested
C++Collections

Remove odd values

Use the erase-remove idiom to filter a C++ vector in place.

C++✓ Tested