Results for “dot”
Small, practical examples. Search by task or narrow things down below.
Remove matching items from a mutable list
C#: List.RemoveAll returns how many items it removed.
C#✓ Tested
Repeat a fixed number of times
C#: Use a counted loop to print three numbered steps.
C#✓ Tested
Repeat while a condition holds
C#: Count down while a positive number remains, updating the loop variable on each iteration.
C#✓ Tested
Replace a path extension
C#: Path.ChangeExtension transforms a path string without moving or creating a file.
C#✓ Tested
Replace literal text
Replace every literal occurrence in a C# string.
C#✓ Tested
Replace one collection element
C#: Update an existing element at a known valid index.
C#✓ Tested
Require two conditions to be true
C#: Combine a lower and an upper bound to check whether a value is in range.
C#✓ Tested
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
Return multiple named values from a method
C#: Named value tuples give lightweight field names without a separate class.
C#✓ Tested
Round a decimal using an explicit midpoint rule
C#: Use decimal literals for decimal arithmetic and choose the midpoint rounding behavior.
C#✓ Tested
Run your first program
C#: Start with a complete program that prints one line. Follow the run instructions below.
C#✓ Tested
Search a sorted array efficiently
C#: Array.BinarySearch requires an array sorted with the same comparison rules.
C#✓ Tested