C# 格式化工具
在线格式化和校验 C# 代码,基于 clang-format 的 WebAssembly 版本,支持 Microsoft、Google、LLVM 等多种风格,直接在浏览器中完成处理。
浏览器本地处理
无需登录
基于 clang-format
语言适用于 C# 代码
C#Program.cs
风格
缩进
行宽
输入可编辑
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
输出C# 有效32 行 · 555 B
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System;
using System.Collections.Generic;
using System.Linq;
namespace MyApp {
public class Person {
public string Name { get; set; }
public int Age { get; set; }
public Person(string name, int age) {
Name = name;
Age = age;
}
public override string ToString() => $"{Name} (age {Age})";
}
class Program {
static void Main(string[] args) {
var people = new List<Person> {
new Person("Alice", 30),
new Person("Bob", 25),
new Person("Carol", 35)
};
var sorted = people.OrderBy(p => p.Age);
foreach (var p in sorted) {
Console.WriteLine(p);
}
}
}
}
UTF-8 · 4 空格 · Microsoft · clang-format本地处理 · 就绪
工具说明C#
简介
把缩进混乱或风格不统一的 C# 代码重新整理成标准格式,底层使用 clang-format 的 WebAssembly 编译版本。支持 Microsoft、Google、LLVM 等七种预设风格,所有处理都在浏览器本地完成,代码不会离开你的设备。
场景
格式化粘贴自文档或 AI 生成的 C# 代码统一团队 C# 代码风格整理缩进混乱的旧代码校验代码语法是否正确
使用步骤
123
粘贴或上传选择风格获取结果