diff --git a/CONTRIBUTORS.svg b/CONTRIBUTORS.svg index 229af9315f9..9c040acf59c 100644 --- a/CONTRIBUTORS.svg +++ b/CONTRIBUTORS.svg @@ -3,7 +3,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="740" - height="156" + height="208" > @@ -88,7 +88,9 @@ + + - + \ No newline at end of file diff --git a/docs/cs.html b/docs/cs.html index a07efc146c2..c8488a611f1 100644 --- a/docs/cs.html +++ b/docs/cs.html @@ -128,14 +128,13 @@

查看: C#字符串

用户输入

-
Console.WriteLine("Enter number:");
-if(int.TryParse(Console.ReadLine(),out int input))
-{
-  // 输入验证
-  Console.WriteLine($"You entered {input}");
-}
+
Console.WriteLine("Enter number:");
+if(int.TryParse(Console.ReadLine(),out int input))
+{
+  // 输入验证
+  Console.WriteLine($"You entered {input}");
+}
 
-

条件判断

int j = 10;
 if (j == 10) {
@@ -220,7 +219,7 @@
 
成员说明
Length返回字符串长度的属性
Compare()比较两个字符串的静态方法
Contains()确定字符串是否包含特定的子字符串
Equals()确定两个字符串是否具有相同的字符数据
Format()通过 {0} 表示法和使用其他原语格式化字符串
Trim()从尾随和前导字符中删除特定字符的所有实例。 默认删除前导和尾随空格
Split()删除提供的字符并从两侧的剩余字符中创建一个数组

逐字字符串

-
string longString = @"I can type any characters in here !#@$%^&*()__+ '' \n \t except double quotes and I will be taken literally. I even work with multiple lines.";
+
string longString = @"I can type any characters in here !#@$%^&*()__+ '' \n \t except double quotes and I will be taken literally. I even work with multiple lines.";
 

成员示例

@@ -239,11 +238,10 @@ Console.WriteLine(sb.ToString()); // => 123456789.... -

对于频繁拼接字符串的场景(如:成百上千次循环),使用 System.Text.StringBuilder 提升性能

- +

对于频繁拼接字符串的场景(如:成百上千次循环),使用 System.Text.StringBuilder 提升性能

原始字符串文本

-
// C#11 语法, 至少3个双引号(""")开头和结尾,内容可以输入任何原始字符
+
// C#11 语法, 至少3个双引号(""")开头和结尾,内容可以输入任何原始字符
 // 单行: 左引号,右引号,内容 三者同行
 string singleLine = """Content begin "Hello World!" end.""";
 
@@ -253,10 +251,9 @@
     """;
 Console.WriteLine(multiLine); // => Content begin "Hello World!" /\n<>"" end.
 
-

杂项

-

常用 .NET 概念

- +

常用 .NET 概念

+ diff --git a/index.html b/index.html index ee6d1f15b00..e3cea5fc8a7 100644 --- a/index.html +++ b/index.html @@ -686,7 +686,7 @@

如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 gh-pages 分支代码到你的静态服务就可以了,还可以使用 docker 快捷部署 web 版。

-
© 2022 Kenny Wang. Updated on 2022/11/21 10:25:45
+