Results for “UTF-8”
Small, practical examples. Search by task or narrow things down below.
Count Unicode code points in a string
JavaScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
JavaScript✓ Tested
Count Unicode code points in a string
TypeScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.
TypeScript✓ Tested
Count words with GroupBy
Group repeated C# words and print ordered counts.
C#✓ Tested
Create a file only when it does not exist
C#: FileMode.CreateNew prevents accidental replacement of existing content.
C#✓ Tested
Create a modified copy of an immutable record
C#: A with expression creates a shallow copy with selected changed properties.
C#✓ Tested
Create a reusable one-to-many lookup
C#: ToLookup groups values by key and returns an empty sequence for an unknown key.
C#✓ Tested
Create a table and insert its first row
Postgres: Define column types and a primary key, then insert one row using an explicit column list.
Postgres✓ Tested
Create an index for an equality filter
Postgres: A nonunique index can support lookups on a frequently filtered column.
Postgres✓ Tested
Create an index matching filter and ordering columns
Postgres: Place the equality-filter column before the ordering column in this composite index.
Postgres✓ Tested
Create nested directories
Create a directory tree using the .NET Directory API.
C#✓ Tested
Debounce a button with a stable-time check
Accept an input change only after it stays stable for 30 ms.
debounce✓ Tested
Decode hexadecimal bytes
C#: FromHexString and ToHexString handle binary data without manually parsing pairs of characters.
C#✓ Tested