Results for “Text cleanup & matching”
Small, practical examples. Search by task or narrow things down below.
Find the first matching value
Find the first matching value in a complete Rust program using the standard library.
Rust✓ 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
Find the nearest matching ancestor
Read a parent row attribute using jQuery closest.
jQuery✓ Tested
Find the position of a matching item
JavaScript: findIndex returns -1 when the predicate matches nothing.
JavaScript✓ Tested
Find the position of a matching item
TypeScript: findIndex returns -1 when the predicate matches nothing.
TypeScript✓ Tested
Format text in lowercase
Format text in lowercase with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Format text through a built-in pipe
Format text through a built-in pipe with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Group matching values while preserving their order
C++: stable_partition keeps the relative order within both predicate groups.
C++✓ Tested
Highlight a relevant phrase in context
HTML: Mark identifies text relevant to the current activity, such as a search match.
HTML✓ Tested
Inherit a parent’s text color
CSS: Learn how to inherit a parent’s text color in a complete browser example.
CSS✓ Tested
Join an array into text
PowerShell: Join an array into text using PowerShell 7.
PowerShell✓ Tested
Join text rows in a chosen order
Combine values using string_agg.
string_agg✓ Tested