FIND YOUR NEXT FEW LINES

Results for “read-only”

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

990 snippets foundClear filters
RustErrors & optional values

Transpose an optional parsing result

Transpose an optional parsing result in a complete Rust program using the standard library.

Rust✓ Tested
C++Text validation & parsing

Trim surrounding ASCII whitespace

C++: Find the first and last non-whitespace bytes before taking a substring.

C++✓ Tested
C#Strings

Trim surrounding whitespace

Remove whitespace at the ends of a C# string.

C#✓ Tested
JavaStrings

Trim surrounding whitespace

Remove leading and trailing whitespace from a Java string.

Java✓ Tested
GoStrings & text

Trim surrounding whitespace

Trim surrounding whitespace using a complete Go program with explicit sample inputs.

Go✓ Tested
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
C#Strings

Try parsing an integer

Use TryParse to avoid exceptions for invalid C# integer input.

C#✓ Tested
TypeScriptUtilities & async

Type an object update with Partial

Allow a caller to provide just the fields to change.

Partial✓ 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