Results for “slice”
Small, practical examples. Search by task or narrow things down below.
Split a slice into two parts
Split a slice into two parts in a complete Rust program using the standard library.
Rust✓ Tested
Write a generic slice helper
Write a generic slice helper using a complete Go program with explicit sample inputs.
Go✓ Tested
Append several values to a vector
Append several values to a vector in a complete Rust program using the standard library.
Rust✓ Tested
Copy a range without changing the source
JavaScript: Array.slice returns a shallow copy of the selected half-open range.
JavaScript✓ Tested
Copy a range without changing the source
TypeScript: Array.slice returns a shallow copy of the selected half-open range.
TypeScript✓ Tested
Deduplicate sorted values
Deduplicate sorted values using a complete Go program with explicit sample inputs.
Go✓ Tested
Extract a substring with range syntax
C#: C# range ends are exclusive; indices operate on UTF-16 code units.
C#✓ Tested
Extract text by start and end positions
JavaScript: String slice uses an inclusive start and exclusive end measured in UTF-16 code units.
JavaScript✓ Tested
Extract text by start and end positions
TypeScript: String slice uses an inclusive start and exclusive end measured in UTF-16 code units.
TypeScript✓ Tested
Find an item’s index
Find an item’s index using a complete Go program with explicit sample inputs.
Go✓ Tested
Inspect overlapping windows
Inspect overlapping windows in a complete Rust program using the standard library.
Rust✓ Tested
Iterate over bounded chunks
Iterate over bounded chunks using a complete Go program with explicit sample inputs.
Go✓ Tested