FIND YOUR NEXT FEW LINES

Results for “dot”

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

131 snippets foundClear filters
C#Collections & data structures

Remove matching items from a mutable list

C#: List.RemoveAll returns how many items it removed.

C#✓ Tested
C#Getting Started

Repeat a fixed number of times

C#: Use a counted loop to print three numbered steps.

C#✓ Tested
C#Getting Started

Repeat while a condition holds

C#: Count down while a positive number remains, updating the loop variable on each iteration.

C#✓ Tested
C#File operations & paths

Replace a path extension

C#: Path.ChangeExtension transforms a path string without moving or creating a file.

C#✓ Tested
C#Strings

Replace literal text

Replace every literal occurrence in a C# string.

C#✓ Tested
C#Getting Started

Replace one collection element

C#: Update an existing element at a known valid index.

C#✓ Tested
C#Getting Started

Require two conditions to be true

C#: Combine a lower and an upper bound to check whether a value is in range.

C#✓ Tested
C#Asynchronous work & URI handling

Resolve a relative URI against a base

C#: Use a base URI ending in a slash when the final path component represents a directory.

C#✓ Tested
C#Types & reliable control flow

Return multiple named values from a method

C#: Named value tuples give lightweight field names without a separate class.

C#✓ Tested
C#Dates & precise numbers

Round a decimal using an explicit midpoint rule

C#: Use decimal literals for decimal arithmetic and choose the midpoint rounding behavior.

C#✓ Tested
C#Getting Started

Run your first program

C#: Start with a complete program that prints one line. Follow the run instructions below.

C#✓ Tested
C#Collections & data structures

Search a sorted array efficiently

C#: Array.BinarySearch requires an array sorted with the same comparison rules.

C#✓ Tested