yield: practical reference
yield: practical reference: yield return produces the next iterator element, while yield break ends the sequence.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
yield: practical reference: yield return produces the next iterator element, while yield break ends the sequence.
Main: practical reference: Main is the classic C# program entry point; valid signatures return void, int, Task, or Task<int>, optionally accept string[] args, and the compiler selects exactly one entry point.
+: practical reference: The + operator adds numbers, concatenates strings, or invokes a user-defined overload.
+=: practical reference: += computes addition and assigns the converted result back to its left operand.
as: practical reference: as attempts a reference, nullable, boxing, or unboxing conversion and returns null on failure.
=: practical reference: = stores a value in a variable, field, property, indexer, or element and is itself an expression.
await: practical reference: await asynchronously waits for an awaitable and resumes the method after completion.
&: practical reference: & performs bitwise AND on integers or non-short-circuit logical AND on bool values.
&=: practical reference: &= combines bitwise or logical AND with assignment to the left operand.
~: practical reference: ~ flips every bit of an integral operand or invokes a user-defined overload.
|: practical reference: | performs bitwise OR on integers or non-short-circuit logical OR on bool values.
|=: practical reference: |= combines OR with assignment to the left location.
^: practical reference: ^ performs bitwise XOR or Boolean exclusive difference.
^=: practical reference: ^= combines XOR with assignment, toggling the selected bits.
The expression `(T)expression` explicitly converts the result of `expression` to type `T`. It can perform a numeric conversion, reference conversion, unboxing, or a user-defined conversion. Success is not guaranteed: it can lose data or throw an exception.
?:: practical reference: ?: selects exactly one of two expressions according to a bool condition.
--: practical reference: -- decreases a variable by one; prefix yields the new value and postfix the previous value.
/: practical reference: / divides according to operand types; integral division truncates the fraction toward zero.
/=: practical reference: /= divides and assigns the result under compound-assignment rules.
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.
==: practical reference: == compares according to the operator defined for the operand types.
>=: practical reference: >= tests whether the left operand is greater than or equal under the type's ordering operator.
>: practical reference: > tests whether the left operand is strictly greater.
++: practical reference: ++ increases a variable by one; prefix yields the new value and postfix the old value.