FIND YOUR NEXT FEW LINES

Results for “struct”

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

152 snippets foundClear filters
CBinary formats & structured parsing

Decode a validated pair of hexadecimal digits

C: Convert each nibble and reject a nonhexadecimal character before combining them.

C✓ Tested
CBinary formats & structured parsing

Encode a byte buffer as hexadecimal

C: Format each byte as an unsigned two-digit hexadecimal value.

C✓ Tested
JavaEncoding & structured values

Encode a form query parameter

Java: URLEncoder uses application/x-www-form-urlencoded rules, including plus signs for spaces.

Java✓ Tested
JavaEncoding & structured values

Encode and decode Base64 bytes

Java: Convert through UTF-8 explicitly before and after Base64 encoding.

Java✓ Tested
PowerShellStructured formats & encodings

Encode and decode UTF-8 text with Base64

PowerShell: Convert the string to bytes explicitly before Base64 encoding.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Escape a single URL parameter value

PowerShell: EscapeDataString encodes one value without treating it as a complete URL.

PowerShell✓ Tested
PowerShellStructured formats & encodings

Escape plain text before placing it in HTML

PowerShell: HtmlEncode converts HTML delimiters to entities in ordinary text contexts.

PowerShell✓ Tested
HTMLAccessible structure

Expose a disclosure button’s expanded state

HTML: Keep aria-expanded synchronized with the controlled panel’s hidden state.

HTML✓ Tested
C#Collections & data structures

Find values common to two collections

C#: Intersect returns distinct values shared by the inputs.

C#✓ Tested
C#Collections & data structures

Find values missing from another collection

C#: Except removes duplicates as it calculates the set difference.

C#✓ Tested
JavaScriptArray restructuring

Flatten a single nesting level

JavaScript: flat defaults to a depth of one and creates a new array.

JavaScript✓ Tested
TypeScriptArray restructuring

Flatten a single nesting level

TypeScript: flat defaults to a depth of one and creates a new array.

TypeScript✓ Tested