string s = "true";
string w = "false";
Console.Write(s +"\r"+w);


output:false

I don't understand how \r works. why is the true missed? please explain .

Recommended Answers

All 2 Replies

Console.Write(s +"\r\n"+w);

to signify new line

string s = "true";
string w = "false";
Console.Write(s +"\r"+w);


output:false

I don't understand how \r works. why is the true missed? please explain .

Value "true" is replaced by "false".

string s = "true";
 string w = "fa";
 Console.Write(s + "\r" + w); //output will be "faue"
 Console.Read();
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.