Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / Knowledge base

Knowledge base

Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.

Entries: 5788

C#

Delegates in `Match` and culture-invariant formatting

Pass separate success and error delegates to `Match` with a shared return type. Use `FormattableString.Invariant` to format interpolation without relying on the current culture.

Advanced · C# 12 and .NET 8; later runtimes may add compatible features
C#

MemoryExtensions.AsSpan and IndexOf: searching a text view

Create a view of text without copying it, search for an element or sequence, and print the matching slice through `Console.Out.Write` without creating a substring.

Advanced · C# 12 and .NET 8; later runtimes may add compatible features
C#

Search, compare, and parse span views

Use spans to search and compare existing text without copying it, then parse fields as `int` or `decimal` with explicit format rules.

Advanced · C# 12 and .NET 8; later runtimes may add compatible features
C#

MidpointRounding.AwayFromZero with decimal.Round

Choose an explicit tie rule: round to the nearest value, but at an exact midpoint choose the result with the larger absolute value.

Advanced · C# 12 and .NET 8; later runtimes may add compatible features
C#

Non-generic IEnumerable and IEnumerator in System.Collections

IEnumerable provides an enumerator, and IEnumerator tracks the position in a sequence. An explicit implementation satisfies the non-generic contract without duplicating iteration logic.

Intermediate · C# 12 and .NET 8; later runtimes may add compatible features
C#

Action<T>, Func<T,TResult>, and Predicate<T> delegates

Store behavior in variables and pass it as arguments: Action performs an operation, Func returns a result, and Predicate tests a condition.

Intermediate · C# 12 and .NET 8; later runtimes may add compatible features
C#

Shallow array cloning and sorting with Comparison<T>

Use `Array.Clone()` to create a separate array, then sort it in place with `Array.Sort` and a `Comparison<T>` delegate. The clone can still share element objects with the original.

Intermediate · C# 12 and .NET 8; later runtimes may add compatible features
C#

System.Index and System.Range: positions and slices

Resolve positions from either end of a sequence, validate slice boundaries, and tell when slicing copies elements or returns a view.

Advanced · C# 12 and .NET 8; later runtimes may add compatible features
C#

BindingFlags: filtering methods with reflection

Combine lookup flags to select methods by visibility, by whether they are instance or static, and by where they are declared.

Advanced · C# 12 and .NET 8; later runtimes may add compatible features