对不起,这可能是一个愚蠢的问题,但它让我烦恼......
int[] i = {3, 2, 1};
//why
Array.Sort(i);
//instead of
i.Sort();
char c = 'c';
//why
char.IsLetter(c);
//instead of
c.Isletter();
Run Code Online (Sandbox Code Playgroud)
感谢 Pedro d'Aquino 指出了其他问题并提供了答案。
基本点是结构上的实例方法不是线程安全的,但静态方法是。
看看这些问题: