[C# 运算符和表达式 - C# 参考 | Microsoft Learn](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/)
| 运算符 | 类别或名称 |
| --- | --- |
| [x.y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/member-access-operators#member-access-expression-)、[f(x)](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/member-access-operators#invocation-expression-)、[a\[i\]](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/member-access-operators#indexer-operator-)、[`x?.y`](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-)、[`x?[y]`](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-)、[x++](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#increment-operator-)、[x--](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#decrement-operator---)、[x!](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/null-forgiving)、[new](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/new-operator)、[typeof](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/type-testing-and-cast#typeof-operator)、[checked](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/keywords/checked)、[unchecked](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/keywords/unchecked)、[default](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/default)、[nameof](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/nameof)、[delegate](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/delegate-operator)、[sizeof](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/sizeof)、[stackalloc](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/stackalloc)、[x->y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/pointer-related-operators#pointer-member-access-operator--) | 主要 |
| [+x](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#unary-plus-and-minus-operators)、[\-x](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#unary-plus-and-minus-operators)、[](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-negation-operator-)x[、](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#bitwise-complement-operator-)~x[、](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#increment-operator-)++x[、](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#decrement-operator---)\--x[、](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/member-access-operators#index-from-end-operator-)^x[、](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/type-testing-and-cast#cast-expression)(T)x[、](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/await)await[、&&x](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/pointer-related-operators#address-of-operator-)、[\*x](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/pointer-related-operators#pointer-indirection-operator-)、[true 和 false](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/true-false-operators) | 一元 |
| [x..y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/member-access-operators#range-operator-) | 范围 |
| [switch](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/switch-expression)、[with](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/with-expression) | `switch`和`with`表达式 |
| [x \* y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#multiplication-operator-)、[x / y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#division-operator-)、[x % y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#remainder-operator-) | 乘法 |
| [x + y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#addition-operator-)、[x – y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#subtraction-operator--) | 加法 |
| [x > y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#right-shift-operator-) | Shift |
| [x y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/comparison-operators#greater-than-operator-)、[x = y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/comparison-operators#greater-than-or-equal-operator-)、[is](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/type-testing-and-cast#is-operator)、[as](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/type-testing-and-cast#as-operator) | 关系和类型测试 |
| [x == y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/equality-operators#equality-operator-)、[x != y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/equality-operators#inequality-operator-) | 相等 |
| `x & y` | [布尔逻辑 AND](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-and-operator-)或[按位逻辑 AND](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#logical-and-operator-) |
| `x ^ y` | [布尔逻辑 XOR](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-exclusive-or-operator-)或[按位逻辑 XOR](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#logical-exclusive-or-operator-) |
| `x | y` | [布尔逻辑 OR](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#logical-or-operator-)或[按位逻辑 OR](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#logical-or-operator-) |
| [x && y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-and-operator-) | 条件“与” |
| [x || y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-or-operator-) | 条件“或” |
| [x ?? y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/null-coalescing-operator) | Null 合并运算符 |
| [c ? t : f](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/conditional-operator) | 条件运算符 |
| [x = y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/assignment-operator)、[x += y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment)、[x -= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment)、[x \*= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment)、[x /= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment)、[x %= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/arithmetic-operators#compound-assignment)、[x &= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment)、[x |= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment)、[x ^= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/boolean-logical-operators#compound-assignment)、[x >= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/bitwise-and-shift-operators#compound-assignment)、[x ??= y](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/null-coalescing-operator)、[\=>](https://learn.microsoft.com/zh-cn/dotnet/csharp/language-reference/operators/lambda-operator) | 赋值和 lambda 声明 |
- Visual Studio 2022安装到非C盘
- .net平台区别
- 常用单词
- 关键字
- 操作符(运算符)
- 标识符(命名规范)
- 开始
- 变量
- 常量
- 数据类型
- 值类型
- 变量数据类型
- 枚举类型enum(常量集合)
- 结构类型struct(结构体)
- 元组类型
- 可null类型(T?)
- 引用类型
- 数组(array)
- 集合(List)
- 内置引用类型
- object
- string
- Dynamic(动态类型)
- delegate委托(代理)类型
- 自定义引用类型
- 接口(interface)
- 类class
- record(定义一个引用类型)
- 指针类型(仅用于非安全代码)
- get和set访问器
- delegate委托
- delegate实现发布订阅与事件
- 类型转换
- 合并操作符??
- 类相关
- Partial 部分类
- 类定义以及访问修饰符(封装)
- abstract抽象类与sealed密封类
- virtual虚方法
- 接口interface
- C# 预处理器指令
- C#技术栈
- 判断(流程控制)与三元运算
- if
- switch
- 三元运算
- 循环
- while 循环
- for循环
- foreach循环
- do...while 循环
- 文件操作
- 其他
- 多开