如何在没有换行符的情况下将字符串打印到控制台?
我的问题是。
如果你想在c#中的问题旁边找到答案,你输入的是什么
我是这样的,但你在问题旁边输入答案。
string product; Console.WriteLine("What is the product you want?"); product = Console.ReadLine();
而不是使用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
打印换行符。
Write
不。