Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / C#

Knowledge base — C#

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

Entries: 443

C#

/=: practical reference

/=: practical reference: /= divides and assigns the result under compound-assignment rules.

Basic · C# language; verified against C# 14 reference
C#

Element access: array[index]

The expression array[index] reads or changes an array element. Square brackets [] also provide indexer access; the meaning of their arguments then depends on the particular type.

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

==: practical reference

==: practical reference: == compares according to the operator defined for the operand types.

Basic · C# language; verified against C# 14 reference
C#

>=: practical reference

>=: practical reference: >= tests whether the left operand is greater than or equal under the type's ordering operator.

Basic · C# language; verified against C# 14 reference
C#

>: practical reference

>: practical reference: > tests whether the left operand is strictly greater.

Basic · C# language; verified against C# 14 reference
C#

++: practical reference

++: practical reference: ++ increases a variable by one; prefix yields the new value and postfix the old value.

Basic · C# language; verified against C# 14 reference
C#

^: practical reference

^: practical reference: ^ creates an Index measured from the end, where ^1 denotes the last element.

Basic · C# language; verified against C# 14 reference
C#

!=: practical reference

!=: practical reference: != negates the equality semantics of the operator defined for the type.

Basic · C# language; verified against C# 14 reference
C#

is: practical reference

is: practical reference: is tests a type or pattern and can bind a narrowed variable; a simple type test returns false, rather than throwing InvalidCastException, for null or a type mismatch.

Basic · C# language; verified against C# 14 reference
C#

=>: practical reference

=>: practical reference: The => operator creates a lambda expression or separates a pattern from its result in a switch expression.

Basic · C# operator reference; verified against C# 14
C#

<<: practical reference

<<: practical reference: << shifts bits left and fills the vacated low positions with zeros.

Basic · C# operator reference; verified against C# 14
C#

<<=: practical reference

<<=: practical reference: <<= shifts the left operand and assigns the converted result back to its type.

Basic · C# operator reference; verified against C# 14
C#

<=: practical reference

<=: practical reference: <= tests whether the left operand is not greater under the type's ordering operator.

Basic · C# operator reference; verified against C# 14
C#

<: practical reference

<: practical reference: < tests whether the left operand strictly precedes the right operand.

Basic · C# operator reference; verified against C# 14
C#

&&: practical reference

&&: practical reference: && returns true only for two true operands and skips the right side after a false left side.

Basic · C# operator reference; verified against C# 14
C#

!: practical reference

!: practical reference: ! negates a bool or calls an overloaded operator; postfix ! separately means null-forgiving.

Basic · C# operator reference; verified against C# 14
C#

||: practical reference

||: practical reference: || returns true after the first true operand and skips the right side.

Basic · C# operator reference; verified against C# 14
C#

Member access: the dot operator (.)

The dot selects a member of an object or type and forms qualified names. Learn the difference between property access, method invocation, and conditional access when a receiver is null.

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

*: practical reference

*: practical reference: * multiplies numbers, dereferences a pointer in unary unsafe use, or invokes an overload.

Basic · C# operator reference; verified against C# 14
C#

*=: practical reference

*=: practical reference: *= multiplies and assigns under compound-assignment conversion rules.

Basic · C# operator reference; verified against C# 14
C#

nameof: practical reference

nameof: practical reference: nameof produces a symbol's name as a compile-time string without evaluating the symbol.

Basic · C# operator reference; verified against C# 14
C#

??: practical reference

??: practical reference: ?? returns its left operand when non-null and otherwise lazily evaluates the right operand.

Basic · C# operator reference; verified against C# 14
C#

??=: practical reference

??=: practical reference: ??= assigns the right value only when the left location is null.

Basic · C# operator reference; verified against C# 14
C#

?.: practical reference

?.: practical reference: ?. and ?[] stop a continuous access chain at null and return null.

Basic · C# operator reference; verified against C# 14