Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions docs/csharp/language-reference/operators/addition-operator.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "+ and += operators - C# reference"
ms.date: 05/24/2019
ms.date: 04/23/2020
f1_keywords:
- "+_CSharpKeyword"
- "+=_CSharpKeyword"
Expand All @@ -22,7 +22,7 @@ For information about the arithmetic `+` operator, see the [Unary plus and minus

## String concatenation

When one or both operands are of type [string](../builtin-types/reference-types.md#the-string-type), the `+` operator concatenates the string representations of its operands:
When one or both operands are of type [string](../builtin-types/reference-types.md#the-string-type), the `+` operator concatenates the string representations of its operands (the string representation of `null` is an empty string):

[!code-csharp-interactive[string concatenation](snippets/AdditionOperator.cs#AddStrings)]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ private static void StringConcatenation()
// <SnippetAddStrings>
Console.WriteLine("Forgot" + "white space");
Console.WriteLine("Probably the oldest constant: " + Math.PI);
Console.WriteLine(null + "Nothing to add.");
// Output:
// Forgotwhite space
// Probably the oldest constant: 3.14159265358979
// Nothing to add.
// </SnippetAddStrings>

// <SnippetUseStringInterpolation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static async Task Main(string[] args)
UserDefinedConversions.Main();
Console.WriteLine();

Console.WriteLine("========= switch expression example =========");
Console.WriteLine("========= switch expression example ============");
SwitchExpressions.Examples();
Console.WriteLine();

Expand Down