Skip to content

Commit cbfb024

Browse files
authored
Reference to more generic, instead of \r\n (dotnet#5439)
1 parent 6e779a7 commit cbfb024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xml/System/Console.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
7070
<xref:System.Console> class members that work normally when the underlying stream is directed to a console might throw an exception if the stream is redirected, for example, to a file. Program your application to catch <xref:System.IO.IOException?displayProperty=nameWithType> exceptions if you redirect a standard stream. You can also use the <xref:System.Console.IsOutputRedirected%2A>, <xref:System.Console.IsInputRedirected%2A>, and <xref:System.Console.IsErrorRedirected%2A> properties to determine whether a standard stream is redirected before performing an operation that throws an <xref:System.IO.IOException?displayProperty=nameWithType> exception.
7171
72-
It is sometimes useful to explicitly call the members of the stream objects represented by the <xref:System.Console.In%2A>, <xref:System.Console.Out%2A>, and <xref:System.Console.Error%2A> properties. For example, by default, the <xref:System.Console.ReadLine%2A?displayProperty=nameWithType> method reads input from the standard input stream. Similarly, the <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> method writes data to the standard output stream, and the data is followed by the default line termination string, which is a carriage return and line feed ("\r\n"). However, the <xref:System.Console> class does not provide a corresponding method to write data to the standard error output stream, or a property to change the line termination string for data written to that stream.
72+
It is sometimes useful to explicitly call the members of the stream objects represented by the <xref:System.Console.In%2A>, <xref:System.Console.Out%2A>, and <xref:System.Console.Error%2A> properties. For example, by default, the <xref:System.Console.ReadLine%2A?displayProperty=nameWithType> method reads input from the standard input stream. Similarly, the <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> method writes data to the standard output stream, and the data is followed by the default line termination string, which can be found at <xref:System.Environment.NewLine?displayProperty=nameWithType>. However, the <xref:System.Console> class does not provide a corresponding method to write data to the standard error output stream, or a property to change the line termination string for data written to that stream.
7373
7474
You can solve this problem by setting the <xref:System.IO.TextWriter.NewLine%2A?displayProperty=nameWithType> property of the <xref:System.Console.Out%2A> or <xref:System.Console.Error%2A> property to another line termination string. For example, the following C# statement sets the line termination string for the standard error output stream to two carriage return and line feed sequences:
7575

0 commit comments

Comments
 (0)