Results for “first”
Small, practical examples. Search by task or narrow things down below.
Read the beginning of a text value
Java: Extract or display the first three ASCII characters from a known nonempty string.
Java✓ Tested
Read the beginning of a text value
JavaScript: Extract or display the first three ASCII characters from a known nonempty string.
JavaScript✓ Tested
Read the beginning of a text value
TypeScript: Extract or display the first three ASCII characters from a known nonempty string.
TypeScript✓ Tested
Read the beginning of a text value
C++: Extract or display the first three ASCII characters from a known nonempty string.
C++✓ Tested
Read the beginning of a text value
C: Extract or display the first three ASCII characters from a known nonempty string.
C✓ Tested
Refresh a cached data attribute deliberately
jQuery: After the first read, data caches a parsed value; removeData forces a new attribute read.
jQuery✓ Tested
Remove a trailing line ending
Use strcspn to terminate a C string at its first newline or carriage return.
C✓ Tested
Remove duplicate records by a selected key
C#: DistinctBy keeps the first record for each key in encounter order.
C#✓ Tested
Remove duplicate values
Use a JavaScript Set to preserve the first occurrence of each primitive value.
JavaScript✓ Tested
Remove duplicate values with a Set
Keep the first occurrence order while deduplicating.
Set✓ Tested
Remove duplicates from a list
Remove repeated hashable values while preserving the order in which they first appeared.
list✓ Tested
Replace all matching text
Normalize repeated whitespace with a regular expression.
regexp_replace✓ Tested