1_C#字符串常见输出

发布时间 2023-12-28 12:42:48作者: LilyFlower

C#字符串输出

namespace Hello
{
    internal class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello, World!");
            string name = "Hello, World!";
            int year = 2023;
            //字符串打印
            Console.WriteLine("The name is {0}, and the year is {1}", name, year);
            Console.WriteLine($"The name is {name}, and the year is {year}");
        }
    }
}