Skip to content

Console.WriteLine -- updating for Try .NET #3347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions xml/System/Console.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4723,6 +4723,8 @@
## Remarks
The default line terminator is a string whose value is a carriage return followed by a line feed ("\r\n" in C#, or `vbCrLf` in Visual Basic). You can change the line terminator by setting the <xref:System.IO.TextWriter.NewLine%2A?displayProperty=nameWithType> property of the <xref:System.Console.Out%2A> property to another string.

[!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)]

]]></format>
</remarks>
</Docs>
Expand Down Expand Up @@ -4771,7 +4773,7 @@
The example changes the line terminator from its default value of "\r\n" or `vbCrLf` to "\r\n\r\n" or `vbCrLf` + `vbCrLf`. It then calls the <xref:System.Console.WriteLine> and <xref:System.Console.WriteLine%28System.String%29> methods to display output to the console.

[!code-cpp[System.Console.WriteLine#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/newline1.cpp#2)]
[!code-csharp[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)]
[!code-csharp-interactive[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)]
[!code-vb[System.Console.WriteLine#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/newline1.vb#2)]

]]></format>
Expand Down Expand Up @@ -4834,7 +4836,7 @@
The following example generates ten random integers and uses the <xref:System.Console.WriteLine%28System.Boolean%29?displayProperty=nameWithType> method to indicate whether they are even.

[!code-cpp[System.Console.WriteLine#4](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/writeline_boolean1.cpp#4)]
[!code-csharp[System.Console.WriteLine#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs#4)]
[!code-csharp-interactive[System.Console.WriteLine#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs#4)]
[!code-vb[System.Console.WriteLine#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/writeline_boolean1.vb#4)]

]]></format>
Expand Down Expand Up @@ -5243,7 +5245,7 @@
The following example uses the <xref:System.Console.WriteLine%28System.Object%29> method to display each value in an object array to the console.

[!code-cpp[System.Console.WriteLine#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/writeline_obj1.cpp#3)]
[!code-csharp[System.Console.WriteLine#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_obj1.cs#3)]
[!code-csharp-interactive[System.Console.WriteLine#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_obj1.cs#3)]
[!code-vb[System.Console.WriteLine#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/writeline_obj1.vb#3)]

]]></format>
Expand Down Expand Up @@ -5364,7 +5366,7 @@
The example changes the line terminator from its default value of "\r\n" or `vbCrLf` to "\r\n\r\n" or `vbCrLf` + `vbCrLf`. It then calls the <xref:System.Console.WriteLine> and <xref:System.Console.WriteLine%28System.String%29> methods to display output to the console.

[!code-cpp[System.Console.WriteLine#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/newline1.cpp#2)]
[!code-csharp[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)]
[!code-csharp-interactive[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)]
[!code-vb[System.Console.WriteLine#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/newline1.vb#2)]

]]></format>
Expand Down Expand Up @@ -5572,7 +5574,7 @@
## Examples
The following example calls the <xref:System.Console.WriteLine%28System.String%2CSystem.Object%29> method to display five randomly generated <xref:System.Boolean> values.

[!code-csharp[System.Console.WriteLine#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/WriteLine6.cs#6)]
[!code-csharp-interactive[System.Console.WriteLine#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/WriteLine6.cs#6)]
[!code-vb[System.Console.WriteLine#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/WriteLine6.vb#6)]

The following example calls the <xref:System.Console.WriteLine%28System.String%2CSystem.Object%29> method to display the current date. Note that the format item in the `format` argument uses the "D" [standard date and time format string](~/docs/standard/base-types/standard-date-and-time-format-strings.md) to display the date in the long date format of the current culture.
Expand Down