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#

Boolean.Parse — converting text to a Boolean value

Boolean.Parse converts text representing True or False to bool. It ignores letter case and leading or trailing whitespace and NUL characters. Invalid input throws an exception rather than returning false.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

Console.Out — the standard output writer

Console.Out exposes a TextWriter representing the application's standard output. It supports direct text output and follows redirection configured through Console.SetOut.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

Console.Write — write without adding a newline

Console.Write writes text to standard output without automatically ending the line. It lets you build output across several calls; Console.WriteLine additionally appends a line terminator.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

Convert.ToInt32(Boolean) — convert bool to 0 or 1

Convert.ToInt32(Boolean) converts false to 0 and true to 1. This static overload on System.Convert returns int and lets you explicitly represent a Boolean value as a number.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

GetCustomAttribute<T> — reading a single attribute

CustomAttributeExtensions.GetCustomAttribute<T> retrieves a single attribute of type T through reflection. Learn its supported targets, null handling, and why multiple matches cause an exception.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

DivideByZeroException — division by zero

System.DivideByZeroException signals division by zero for integers and decimal. Learn how to handle it and how this differs from float and double, which can return infinity or NaN instead.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

Double.Parse — converting text to double

Double.Parse converts text to double. Culture determines separators, while NumberStyles controls the permitted syntax.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

Double.ToString — formatting a number with an explicit provider

Double.ToString(string, IFormatProvider) converts a double value to text while letting you choose the numeric format and cultural rules separately. If the provider's GetFormat method returns null when asked for NumberFormatInfo, formatting falls back to the current culture.

Basic · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

Encoding ASCII into a Span<byte> buffer

Use Encoding.ASCII to encode a ReadOnlySpan<char> into a Span<byte> buffer. GetByteCount calculates the required size, while GetBytes writes the bytes and returns their count. Default replacement of non-ASCII text can lose data.

Intermediate · .NET 10; repository net10.0 and LangVersion=preview; feature versions require per-entry verification
C#

Enumerable.Aggregate: practical reference

Enumerable.Aggregate: practical reference: Immediately enumerates the source and folds its elements into one value with an accumulator. The seeded overload starts from the explicit seed; the unseeded overload uses the first element.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.All: practical reference

Enumerable.All: practical reference: Immediately tests the predicate and stops at the first element that returns false. It returns true only when every element read satisfies the condition.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Any: practical reference

Enumerable.Any: practical reference: Without a predicate it tests whether an element exists; with a predicate it stops at the first true match. It does not count the whole sequence when it can answer earlier.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.AsEnumerable: practical reference

Enumerable.AsEnumerable: practical reference: Returns the same reference viewed through IEnumerable<T>; it neither copies, buffers, nor enumerates elements. It can also force selection of LINQ-to-Objects operators.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Average: practical reference

Enumerable.Average: practical reference: Immediately enumerates numeric values and returns the mean in the overload-specific result type. Nullable overloads ignore null values.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Chunk: practical reference

Enumerable.Chunk: practical reference: Deferred enumeration groups consecutive elements into new arrays whose length is at most size. The final array can be shorter.

Basic · .NET 6+; verified on .NET 10.0.14
C#

Enumerable.Concat: practical reference

Enumerable.Concat: practical reference: The deferred result yields every element of the first source and then every element of the second, retaining duplicates.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Contains: practical reference

Enumerable.Contains: practical reference: Immediately enumerates to the first element equal to the sought value under the supplied IEqualityComparer<T> or EqualityComparer<T>.Default.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Count: practical reference

Enumerable.Count: practical reference: Returns the number of all elements or of elements satisfying a predicate. It may read a collection Count without enumeration, but enumerates a general IEnumerable<T>.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Distinct: practical reference

Enumerable.Distinct: practical reference: Deferred enumeration returns the first occurrence of each value under the equality comparer and stores a set of keys already seen.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.DistinctBy: practical reference

Enumerable.DistinctBy: practical reference: Like Distinct, but uniqueness is computed from the key returned by keySelector; the result contract is unordered.

Basic · .NET 6+; verified on .NET 10.0.14
C#

Enumerable.Empty: practical reference

Enumerable.Empty: practical reference: Returns an empty typed sequence containing no elements. The implementation may share an instance, but code should rely only on IEnumerable<T>.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.Except: practical reference

Enumerable.Except: practical reference: The deferred result returns unique elements of the first source absent from the second under the comparer. The second source is buffered in a set.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.First: practical reference

Enumerable.First: practical reference: Immediately returns the first element or first predicate match and ends enumeration.

Basic · .NET LINQ; verified on .NET 10.0.14
C#

Enumerable.FirstOrDefault: practical reference

Enumerable.FirstOrDefault: practical reference: Immediately returns the first element or predicate match; when none exists it returns default(T) or an explicitly supplied default value.

Basic · .NET LINQ; verified on .NET 10.0.14