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 0000000000000000000000000000000000000000..58af4203df4bc9318a00673f315a07564fd4a487 --- /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 0000000000000000000000000000000000000000..bca6e87b94d718e97cd3ebc427d0c9e6e59e5c4d --- /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 5b7ac7a917305609c0e92c8d004e9dcb216bbfdc..5f1936ad3b6633b895bcafd297101ad7f2ac1d9d 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 0000000000000000000000000000000000000000..d62d0c1e703d108b692ac48fe2ec97b59b5f4a86 --- /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 0000000000000000000000000000000000000000..40c60dd4c884340c455eab8a0020f7c681a4e76c --- /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 + + +