FIND YOUR NEXT FEW LINES

Results for “only”

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

621 snippets foundClear filters
C#Data & dates

Format a decimal amount

Use invariant culture to print a C# decimal with two places.

C#✓ Tested
JavaNumbers & dates

Format a decimal number

Format a Java decimal with two digits and a fixed locale.

Java✓ Tested
GoGetting Started

Format a readable status message

Format a readable status message using a complete Go program with explicit sample inputs.

Go✓ Tested
GoDates & times

Format a UTC timestamp

Format a UTC timestamp using a complete Go program with explicit sample inputs.

Go✓ Tested
RustParsing & byte data

Format an integer as padded hexadecimal

Format an integer as padded hexadecimal in a complete Rust program using the standard library.

Rust✓ Tested
CSmall algorithms & bit operations

Generate a bounded Fibonacci sequence

C: Keep only the two previous values instead of using exponential recursive calls.

C✓ Tested
TypeScriptTypes & functions

Give an optional property a default

Handle missing object fields with nullish coalescing.

optional✓ Tested
GoGetting Started

Group fields in a struct

Group fields in a struct using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Grow a vector

Grow a vector in a complete Rust program using the standard library.

Rust✓ Tested
GoGetting Started

Handle a failed conversion

Handle a failed conversion using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Handle a parsing Result

Handle a parsing Result in a complete Rust program using the standard library.

Rust✓ Tested
RustGetting Started

Handle an optional value

Handle an optional value in a complete Rust program using the standard library.

Rust✓ Tested