From eb56e3fd1d4438a1cb60a5d6b19446913430dfd9 Mon Sep 17 00:00:00 2001 From: feilong Date: Wed, 15 Dec 2021 15:53:45 +0800 Subject: [PATCH] =?UTF-8?q?C#=E7=AC=AC2=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../String.json" | 5 ++ .../String.md" | 90 +++++++++++++++++++ .../config.json" | 4 +- .../sample/Program.cs" | 22 +++++ .../sample/sample.csproj" | 10 +++ 5 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 "data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.json" create mode 100644 "data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.md" create mode 100644 "data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/Program.cs" create mode 100644 "data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/sample.csproj" diff --git "a/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.json" "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.json" new file mode 100644 index 0000000..58af420 --- /dev/null +++ "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.json" @@ -0,0 +1,5 @@ +{ + "type": "code_options", + "author": "huanhuilong", + "source": "String.md" +} \ No newline at end of file diff --git "a/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.md" "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.md" new file mode 100644 index 0000000..bca6e87 --- /dev/null +++ "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/String.md" @@ -0,0 +1,90 @@ +# C# 字符串类型 + +以下使用 C# 字符串类型的语句,哪些都是对的? + +一: + +```csharp +Console.WriteLine("Hello, World!"); +``` + +二: + +```csharp +string helloworld1 = "Hello, World!"; +Console.WriteLine(helloworld1); +``` + +三: + +```csharp +String helloworld2 = "Hello, World!"; +Console.WriteLine(helloworld2); +``` + +四: + +```csharp +var helloworld3 = "Hello, World!"; +Console.WriteLine(helloworld3); +``` + +五: + +```csharp +string $helloworld4 = "Hello, World!"; +Console.WriteLine($helloworld3); +``` + +六: + +```csharp +string helloworld5 = 'Hello, World!'; +Console.WriteLine($helloworld5); +``` + +七: + +```csharp +var helloworld6; +helloworld6 = "Hello, World!"; +Console.WriteLine(helloworld6); +``` + +## 答案 + +```csharp +一、二、三、四 +``` + +## 选项 + +### A + +```csahrp +一、二、三、五 +``` + +### B + +```csharp +一、二、四、六 +``` + +### C + +```csharp +一、三、四、七 +``` + +### D + +```csharp +三、四、五、七 +``` + +### E + +```csharp +二、四、五、六 +``` diff --git "a/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/config.json" "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/config.json" index 5b7ac7a..5f1936a 100644 --- "a/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/config.json" +++ "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/config.json" @@ -2,5 +2,7 @@ "node_id": "csharp-052799fae6c2498f9ef2966925377631", "keywords": [], "children": [], - "export": [] + "export": [ + "String.json" + ] } \ No newline at end of file diff --git "a/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/Program.cs" "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/Program.cs" new file mode 100644 index 0000000..d62d0c1 --- /dev/null +++ "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/Program.cs" @@ -0,0 +1,22 @@ +// See https://aka.ms/new-console-template for more information + +Console.WriteLine("Hello, World!"); + +string helloworld1 = "Hello, World!"; +Console.WriteLine(helloworld1); + +String helloworld2 = "Hello, World!"; +Console.WriteLine(helloworld2); + +var helloworld3 = "Hello, World!"; +Console.WriteLine(helloworld3); + +string $helloworld4 = "Hello, World!"; +Console.WriteLine($helloworld3); + +string helloworld5 = 'Hello, World!'; +Console.WriteLine($helloworld5); + +var helloworld6; +helloworld6 = "Hello, World!"; +Console.WriteLine(helloworld6); \ No newline at end of file diff --git "a/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/sample.csproj" "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/sample.csproj" new file mode 100644 index 0000000..40c60dd --- /dev/null +++ "b/data/1..NET\345\210\235\351\230\266/2.C#\350\257\255\346\263\225/2.C#\346\226\207\346\234\254\345\200\274\345\222\214\345\217\230\351\207\217/sample/sample.csproj" @@ -0,0 +1,10 @@ + + + + Exe + net6.0 + enable + enable + + + -- GitLab