D
D
Dmitry Korolev2018-10-14 23:33:55
C++ / C#
Dmitry Korolev, 2018-10-14 23:33:55

Why does readline return a carriage to the beginning of a line?

Can you please explain why she hates me so much?
baby code

string s = Console.ReadLine();
            Console.WriteLine(s.ToLower());
            if (s.ToLower() == "rus")
            {
                Run();
            }

behaves adequately at first, and now returns the caret to the beginning of the line to write over the written line after pressing the center
only I applied Console.TreatControlCAsInput = true;
how now to just enter text and check it?
have to hit the keyboard

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Korolev, 2018-10-15
@adressmoeistranici

https://docs.microsoft.com/en-us/dotnet/api/system...

P
Peter, 2018-10-15
@Morpheus_God

So after you enter, you output what you wrote. ReadLine displays the contents of the variable to you, and then you display it again through WriteLine.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question