|
4726 | 4726 | ## Remarks
|
4727 | 4727 | 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.
|
4728 | 4728 |
|
| 4729 | + [!INCLUDE[interactive-note](~/includes/csharp-interactive-note-some.md)] |
| 4730 | +
|
4729 | 4731 | ]]></format>
|
4730 | 4732 | </remarks>
|
4731 | 4733 | </Docs>
|
|
4774 | 4776 | 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.
|
4775 | 4777 |
|
4776 | 4778 | [!code-cpp[System.Console.WriteLine#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/newline1.cpp#2)]
|
4777 |
| - [!code-csharp[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)] |
| 4779 | + [!code-csharp-interactive[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)] |
4778 | 4780 | [!code-vb[System.Console.WriteLine#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/newline1.vb#2)]
|
4779 | 4781 |
|
4780 | 4782 | ]]></format>
|
|
4837 | 4839 | 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.
|
4838 | 4840 |
|
4839 | 4841 | [!code-cpp[System.Console.WriteLine#4](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/writeline_boolean1.cpp#4)]
|
4840 |
| - [!code-csharp[System.Console.WriteLine#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs#4)] |
| 4842 | + [!code-csharp-interactive[System.Console.WriteLine#4](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_boolean1.cs#4)] |
4841 | 4843 | [!code-vb[System.Console.WriteLine#4](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/writeline_boolean1.vb#4)]
|
4842 | 4844 |
|
4843 | 4845 | ]]></format>
|
|
5246 | 5248 | The following example uses the <xref:System.Console.WriteLine%28System.Object%29> method to display each value in an object array to the console.
|
5247 | 5249 |
|
5248 | 5250 | [!code-cpp[System.Console.WriteLine#3](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/writeline_obj1.cpp#3)]
|
5249 |
| - [!code-csharp[System.Console.WriteLine#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_obj1.cs#3)] |
| 5251 | + [!code-csharp-interactive[System.Console.WriteLine#3](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/writeline_obj1.cs#3)] |
5250 | 5252 | [!code-vb[System.Console.WriteLine#3](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/writeline_obj1.vb#3)]
|
5251 | 5253 |
|
5252 | 5254 | ]]></format>
|
|
5367 | 5369 | 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.
|
5368 | 5370 |
|
5369 | 5371 | [!code-cpp[System.Console.WriteLine#2](~/samples/snippets/cpp/VS_Snippets_CLR_System/system.Console.WriteLine/CPP/newline1.cpp#2)]
|
5370 |
| - [!code-csharp[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)] |
| 5372 | + [!code-csharp-interactive[System.Console.WriteLine#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/newline1.cs#2)] |
5371 | 5373 | [!code-vb[System.Console.WriteLine#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/newline1.vb#2)]
|
5372 | 5374 |
|
5373 | 5375 | ]]></format>
|
|
5575 | 5577 | ## Examples
|
5576 | 5578 | The following example calls the <xref:System.Console.WriteLine%28System.String%2CSystem.Object%29> method to display five randomly generated <xref:System.Boolean> values.
|
5577 | 5579 |
|
5578 |
| - [!code-csharp[System.Console.WriteLine#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/WriteLine6.cs#6)] |
| 5580 | + [!code-csharp-interactive[System.Console.WriteLine#6](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Console.WriteLine/CS/WriteLine6.cs#6)] |
5579 | 5581 | [!code-vb[System.Console.WriteLine#6](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Console.WriteLine/VB/WriteLine6.vb#6)]
|
5580 | 5582 |
|
5581 | 5583 | 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.
|
|
0 commit comments