FIND YOUR NEXT FEW LINES

Results for “write file”

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

880 snippets foundClear filters
RustStrings & Unicode

Trim whitespace around text

Trim whitespace around text in a complete Rust program using the standard library.

Rust✓ Tested
GoConcurrency & cancellation

Try a channel receive without blocking

Try a channel receive without blocking using a complete Go program with explicit sample inputs.

Go✓ Tested
GitRestoring & revising local work

Uncommit a local change and leave its edits unstaged

Git: A mixed reset resets the index while retaining working-file contents.

Git✓ Tested
GitRestoring & revising local work

Uncommit the latest local change while keeping it staged

Git: A soft reset moves the branch tip but preserves both index and working files.

Git✓ Tested
GoGetting Started

Understand default zero values

Understand default zero values using a complete Go program with explicit sample inputs.

Go✓ Tested
GoGetting Started

Update a value through a pointer

Update a value through a pointer using a complete Go program with explicit sample inputs.

Go✓ Tested
RustThreads & shared ownership

Update an atomic counter

Update an atomic counter in a complete Rust program using the standard library.

Rust✓ Tested
RustMaps & sets

Update an existing map value

Update an existing map value in a complete Rust program using the standard library.

Rust✓ Tested
RustGetting Started

Update an explicitly mutable variable

Update an explicitly mutable variable in a complete Rust program using the standard library.

Rust✓ Tested
GoGetting Started

Use a condition-only for loop

Use a condition-only for loop using a complete Go program with explicit sample inputs.

Go✓ Tested
PowerShellGetting Started

Use a counted loop

PowerShell: Use a counted loop using PowerShell 7.

PowerShell✓ Tested
PowerShellHashtables & object records

Use a fallback for a missing hashtable entry

PowerShell: Test the key explicitly so legitimate false or zero values are preserved.

PowerShell✓ Tested