FIND YOUR NEXT FEW LINES

Results for “only”

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

621 snippets foundClear filters
RustNumbers & durations

Check whether a floating-point value is finite

Check whether a floating-point value is finite in a complete Rust program using the standard library.

Rust✓ Tested
GoTesting & reusable helpers

Check whether bytes contain valid JSON

Check whether bytes contain valid JSON using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaStrings

Check whether text contains a phrase

Use a case-sensitive Java substring check.

Java✓ Tested
GoGetting Started

Choose a branch with if and else

Choose a branch with if and else using a complete Go program with explicit sample inputs.

Go✓ Tested
RustGetting Started

Choose an action with match

Choose an action with match in a complete Rust program using the standard library.

Rust✓ Tested
C#Getting Started

Choose between two branches

C#: Use if and else to handle an available or empty stock count.

C#✓ Tested
RustGetting Started

Choose floating-point arithmetic

Choose floating-point arithmetic in a complete Rust program using the standard library.

Rust✓ Tested
GoGetting Started

Choose floating-point division

Choose floating-point division using a complete Go program with explicit sample inputs.

Go✓ Tested
RustNumbers & durations

Clamp a number to a valid interval

Clamp a number to a valid interval in a complete Rust program using the standard library.

Rust✓ Tested
C#Dates & precise numbers

Clamp a number to inclusive bounds

C#: Math.Clamp returns the nearest endpoint when the value lies outside the range.

C#✓ Tested
GoTesting & reusable helpers

Clamp a value to an allowed interval

Clamp a value to an allowed interval using a complete Go program with explicit sample inputs.

Go✓ Tested
Bash ScriptsFiles & reliability

Clean up a temporary directory automatically

Use an EXIT trap so temporary files are removed when the script ends.

mktemp✓ Tested