From cf83d70f322e906c311f5e1e068a44410ac08fb6 Mon Sep 17 00:00:00 2001 From: jaywcjlove Date: Tue, 10 Jan 2023 13:10:21 +0000 Subject: [PATCH] doc: update cs.md (#266) cb7b542fb15f613b11aa44fdfb96c6ee5b9a374b --- docs/cs.html | 22 ++++++++++++++++++++++ index.html | 5 ++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/docs/cs.html b/docs/cs.html index db38e9d8..559c1798 100644 --- a/docs/cs.html +++ b/docs/cs.html @@ -253,6 +253,28 @@ """; Console.WriteLine(multiLine); // => Content begin "Hello World!" /\n<>"" end. +

###字符串操作

+
//字符串分割
+string Name = "字A符A串A分A割";
+string[] Names=Name.Split(new char[] { 'A' });
+//会以A为媒介把字符串分成若干份
+for (int i = 0; i < Names.Length; i++)
+{
+    Console.Write(Names[i]);
+}
+//-----------------------------------
+//字符串截取
+string Str = "字符串截取";
+Str = Str.Substring(2, 1);
+Console.WriteLine(Str);
+//输出结果“串”,意为从第二个下标开始截取一位字符
+//-----------------------------------
+//字符串替换
+string Rep = "字符1替换";
+Rep = Rep.Replace("1", "串");
+Console.WriteLine(Rep);
+//会把字符中的 “1”替换成“串”
+

杂项

常用 .NET 概念

diff --git a/index.html b/index.html index 19e7706a..93b9e2c3 100644 --- a/index.html +++ b/index.html @@ -814,6 +814,9 @@ Mariusz Michalowski + + Monet Lee + Noryu @@ -1051,7 +1054,7 @@

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

-
+