Results for “only”
Small, practical examples. Search by task or narrow things down below.
Parse an email address syntax
Parse an email address syntax using a complete Go program with explicit sample inputs.
Go✓ Tested
Parse an enum name without throwing
C#: Combine TryParse and IsDefined when only named declared values should be accepted.
C#✓ Tested
Parse an integer safely
Handle invalid Java integer input with NumberFormatException.
Java✓ Tested
Parse and format a date
Convert a date string into a datetime object, then format it in a different, human-readable order.
date✓ Tested
Partition values into two collections
Partition values into two collections in a complete Rust program using the standard library.
Rust✓ Tested
Pass behavior as a function delegate
C#: Func describes a callable with typed parameters and a return value.
C#✓ Tested
Perform cleanup even after an exception
C#: A finally block runs after a handled failure as well as after success.
C#✓ Tested
Preallocate a slice’s capacity
Preallocate a slice’s capacity using a complete Go program with explicit sample inputs.
Go✓ Tested
Preserve a feature branch boundary with a merge commit
Git: No-ff records a merge commit even when a fast-forward would be possible.
Git✓ Tested
Preserve a large JSON integer
Preserve a large JSON integer using a complete Go program with explicit sample inputs.
Go✓ Tested
Preview removal of an untracked scratch file
Git: The dry-run flag shows what clean would remove without deleting it.
Git✓ Tested
Print a collection for inspection
Print a collection for inspection in a complete Rust program using the standard library.
Rust✓ Tested