Category: code

codedev pot

hot operators

https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/

its the power of operators, so always learn try and play

OperatorsCategory or name
x.yf(x)a[i]x?.yx?[y]x++x--x!newtypeofcheckeduncheckeddefaultnameofdelegatesizeofstackallocx->yPrimary
+x-x!x~x++x--x^x(T)xawait&x*xtrue and falseUnary
x..yRange
switchwithswitch and with expressions
x * yx / yx % yMultiplicative
x + yx – yAdditive
x << yx >> yx >>> yShift
x < yx > yx <= yx >= yisasRelational and type-testing
x == yx != yEquality
x & yBoolean logical AND or bitwise logical AND
x ^ yBoolean logical XOR or bitwise logical XOR
x | yBoolean logical OR or bitwise logical OR
x && yConditional AND
x || yConditional OR
x ?? yNull-coalescing operator
c ? t : fConditional operator
x = yx += yx -= yx *= yx /= yx %= yx &= yx |= yx ^= yx <<= yx >>= yx >>>= yx ??= y=>Assignment and lambda declaration
operators