C#控制台基础 console.writeline中写加号为何能连接多个字符串之string.concat

时间:2021-11-21 01:03:11

1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 6 7 namespace ConsoleApplication3 8 { 9 class Program 10 { 11 static void Main(string[] args) 12 { 13 int num1 = 10; 14 int num2 = 10; 15 double num3 = 10.1; 16 17 Console.WriteLine(num1.ToString()+num2.ToString()+num3.ToString()); 18 Console.ReadKey(); 19 } 20 } 21 }

2、效果

C#控制台基础 console.writeline中写加号为何能连接多个字符串之string.concat

咱们用反编译看看代码,