FIND YOUR NEXT FEW LINES

Results for “C#”

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

3000 snippets foundClear filters
Bash ScriptsInput streams & redirection

Substitute values into a multiline template

Bash Scripts: An unquoted heredoc delimiter enables parameter expansion in the template.

Bash Scripts✓ Tested
Bash ScriptsLoops & decisions

Sum a range of integers

Use an arithmetic loop without launching external processes.

arithmetic✓ Tested
CArrays

Sum array values

Iterate over a fixed C array using a size-derived element count.

C✓ Tested
C#Data & dates

Sum integer values

Sum a C# sequence using LINQ.

C#✓ Tested
ReactGetting Started

Supply a default prop value

Supply a default prop value with a small React component and explicit browser behavior.

React✓ Tested
HTMLMetadata & document links

Supply a title and URL for link previews

HTML: Open Graph metadata describes a shared page without changing its visible content.

HTML✓ Tested
CDynamic memory & ownership

Swap owned buffers by swapping their pointers

C: Pointer swaps avoid copying the underlying data.

C✓ Tested
CNumbers & memory

Swap two integers

Use a temporary value to swap C integers without arithmetic overflow.

C✓ Tested
PythonIteration & sequences

Take a limited number of iterator values

Python: Use islice to consume only the requested prefix of a potentially unbounded iterator.

Python✓ Tested
JavaQueues & collection operations

Take an immutable list snapshot

Java: List.copyOf protects the snapshot from later changes to the source list.

Java✓ Tested
CSSGetting Started

Target a unique element by ID

CSS: Learn how to target a unique element by ID in a complete browser example.

CSS✓ Tested
CSmall algorithms & bit operations

Test whether an unsigned value is a power of two

C: A nonzero power of two has exactly one set bit.

C✓ Tested