日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > C# >内容正文

C#

c#打印程序原码_C#程序打印新行

發(fā)布時(shí)間:2025/3/11 C# 31 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c#打印程序原码_C#程序打印新行 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

c#打印程序原碼

C#打印新行 (C# printing a new line)

To print a new line within the message while printing it on the console, we can use following methods,

要在控制臺(tái)上打印消息時(shí)在消息中打印新行,我們可以使用以下方法,

  • Using \n – prints new line

    使用\ n –打印新行

  • Using \x0A or \xA (ASCII literal of \n) – prints new line

    使用\ x0A或\ xA (\ n的ASCII文字)–打印新行

  • Console.WriteLine() – prints new line, if we write any message in the method – it will print new line after the message, if we do not write any message – it will print a new line only.

    Console.WriteLine() –如果在方法中寫(xiě)入任何消息,則打印新行–如果在消息中不寫(xiě)入任何消息,則它將在消息后打印新行–僅打印新行。

C#代碼以打印新行 (C# code to print new line )

In the below example – we are printing new lines between the messages or/and after the message.

在下面的示例中,我們?cè)谙⒅g或消息之后和之后打印新行。

// C# program to print a new line using System; using System.IO; using System.Text;namespace IncludeHelp {class Test{// Main Method static void Main(string[] args){//using \nConsole.WriteLine("Hello\nWorld");//using \x0AConsole.WriteLine("Hello\x0AWorld");Console.WriteLine();Console.WriteLine("end of the program");//hit ENTER to exit the programConsole.ReadLine();}} }

Output

輸出量

Hello World Hello Worldend of the program

翻譯自: https://www.includehelp.com/dot-net/print-a-new-line-example-in-c-sharp.aspx

c#打印程序原碼

總結(jié)

以上是生活随笔為你收集整理的c#打印程序原码_C#程序打印新行的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。