I want to put a character before the user input, like in the regular cmd. I tried
Console.WriteLine("]", input = Console.ReadLine())
where input is the string that gets the user input, but it does not work. I also tried something on the lines of Console.WriteLine("]" + input = Console.ReadLine());
but this returned me the error 'The left hand side of an assignment must be a variable, property or indexer'.
Asked
Active
Viewed 2,879 times
0

Terpomo
- 9
- 1
- 2
-
2`Console.Write("]"); input = Console.ReadLine();` – adjan May 11 '17 at 22:34
-
The difference is, `WriteLine()` adds a newline character to the end of the line. `Write()` does not. – Rufus L May 11 '17 at 22:37
1 Answers
3
Use Console.Write
instead of Console.WriteLine
to read the input from same line
Console.Write("]"); // does not insert new line after ]
input = Console.ReadLine();

Sergey Berezovskiy
- 232,247
- 41
- 429
- 459