我的問題是。如何在不使用換行符的情況下將字符串打印到控制檯?
你有什麼事類型,當你想你的答案你在C#
我的意思是這樣,但你鍵入旁邊問題的答案的問題旁邊。
string product;
Console.WriteLine("What is the product you want?");
product = Console.ReadLine();
我的問題是。如何在不使用換行符的情況下將字符串打印到控制檯?
你有什麼事類型,當你想你的答案你在C#
我的意思是這樣,但你鍵入旁邊問題的答案的問題旁邊。
string product;
Console.WriteLine("What is the product you want?");
product = Console.ReadLine();
這聽起來像你試圖擺脫換行。
WriteLine
打印換行符。
Write
沒有。
而不是使用Console.WriteLine()
使用Console.Write()
string product;
Console.Write("What is the product you want?");
product = Console.ReadLine();
我相信你正在尋找Console.Write("your text here");
而不是Console.WriteLine("your text here");
用書寫()代替的WriteLine()。 – 2012-01-16 21:43:22
請嘗試接受你作爲答案得到的答案中的最佳解決方案。 – Bastardo 2012-01-17 13:46:40