FIND YOUR NEXT FEW LINES

Results for “first”

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

145 snippets foundClear filters
JavaGetting Started

Read the beginning of a text value

Java: Extract or display the first three ASCII characters from a known nonempty string.

Java✓ Tested
JavaScriptGetting Started

Read the beginning of a text value

JavaScript: Extract or display the first three ASCII characters from a known nonempty string.

JavaScript✓ Tested
TypeScriptGetting Started

Read the beginning of a text value

TypeScript: Extract or display the first three ASCII characters from a known nonempty string.

TypeScript✓ Tested
C++Getting Started

Read the beginning of a text value

C++: Extract or display the first three ASCII characters from a known nonempty string.

C++✓ Tested
CGetting Started

Read the beginning of a text value

C: Extract or display the first three ASCII characters from a known nonempty string.

C✓ Tested
jQueryForm serialization & state

Refresh a cached data attribute deliberately

jQuery: After the first read, data caches a parsed value; removeData forces a new attribute read.

jQuery✓ Tested
CStrings

Remove a trailing line ending

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

C✓ Tested
C#LINQ transformations

Remove duplicate records by a selected key

C#: DistinctBy keeps the first record for each key in encounter order.

C#✓ Tested
JavaScriptArrays

Remove duplicate values

Use a JavaScript Set to preserve the first occurrence of each primitive value.

JavaScript✓ Tested
TypeScriptCollections & records

Remove duplicate values with a Set

Keep the first occurrence order while deduplicating.

Set✓ Tested
PythonCollections

Remove duplicates from a list

Remove repeated hashable values while preserving the order in which they first appeared.

list✓ Tested
PostgresWindows & text

Replace all matching text

Normalize repeated whitespace with a regular expression.

regexp_replace✓ Tested