Skip to content

Commit f1bda1b

Browse files
pkulikovBillWagner
authored andcommitted
Interpolated expression -> interpolation expression (#12518)
1 parent e03fe97 commit f1bda1b

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

docs/csharp/language-reference/tokens/interpolated.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.author: ronpet
1616
---
1717
# $ - string interpolation (C# Reference)
1818

19-
The `$` special character identifies a string literal as an *interpolated string*. An interpolated string is a string literal that might contain *interpolated expressions*. When an interpolated string is resolved to a result string, items with interpolated expressions are replaced by the string representations of the expression results. This feature is available in C# 6 and later versions of the language.
19+
The `$` special character identifies a string literal as an *interpolated string*. An interpolated string is a string literal that might contain *interpolation expressions*. When an interpolated string is resolved to a result string, items with interpolation expressions are replaced by the string representations of the expression results. This feature is available in C# 6 and later versions of the language.
2020

2121
String interpolation provides a more readable and convenient syntax to create formatted strings than a [string composite formatting](../../../standard/base-types/composite-formatting.md) feature. The following example uses both features to produce the same output:
2222

@@ -26,18 +26,18 @@ String interpolation provides a more readable and convenient syntax to create fo
2626

2727
To identify a string literal as an interpolated string, prepend it with the `$` symbol. You cannot have any white space between the `$` and the `"` that starts a string literal. Doing so causes a compile-time error.
2828

29-
The structure of an item with an interpolated expression is as follows:
29+
The structure of an item with an interpolation expression is as follows:
3030

3131
```
32-
{<interpolatedExpression>[,<alignment>][:<formatString>]}
32+
{<interpolationExpression>[,<alignment>][:<formatString>]}
3333
```
3434

3535
Elements in square brackets are optional. The following table describes each element:
3636

3737
|Element|Description|
3838
|-------------|-----------------|
39-
|`interpolatedExpression`|The expression that produces a result to be formatted. String representation of the `null` result is <xref:System.String.Empty?displayProperty=nameWithType>.|
40-
|`alignment`|The constant expression whose value defines the minimum number of characters in the string representation of the result of the interpolated expression. If positive, the string representation is right-aligned; if negative, it's left-aligned. For more information, see [Alignment Component](../../../standard/base-types/composite-formatting.md#alignment-component).|
39+
|`interpolationExpression`|The expression that produces a result to be formatted. String representation of the `null` result is <xref:System.String.Empty?displayProperty=nameWithType>.|
40+
|`alignment`|The constant expression whose value defines the minimum number of characters in the string representation of the result of the interpolation expression. If positive, the string representation is right-aligned; if negative, it's left-aligned. For more information, see [Alignment Component](../../../standard/base-types/composite-formatting.md#alignment-component).|
4141
|`formatString`|A format string that is supported by the type of the expression result. For more information, see [Format String Component](../../../standard/base-types/composite-formatting.md#format-string-component).|
4242

4343
The following example uses optional formatting components described above:
@@ -48,9 +48,9 @@ The following example uses optional formatting components described above:
4848

4949
To include a brace, "{" or "}", in the text produced by an interpolated string, use two braces, "{{" or "}}". For more information, see [Escaping Braces](../../../standard/base-types/composite-formatting.md#escaping-braces).
5050

51-
As the colon (":") has special meaning in an interpolated expression item, in order to use a [conditional operator](../operators/conditional-operator.md) in an interpolated expression, enclose that expression in parentheses.
51+
As the colon (":") has special meaning in an interpolation expression item, in order to use a [conditional operator](../operators/conditional-operator.md) in an interpolation expression, enclose that expression in parentheses.
5252

53-
The following example shows how to include a brace in a result string and how to use a conditional operator in an interpolated expression:
53+
The following example shows how to include a brace in a result string and how to use a conditional operator in an interpolation expression:
5454

5555
[!code-csharp-interactive[example with ternary conditional operator](~/samples/snippets/csharp/language-reference/tokens/string-interpolation.cs#3)]
5656

@@ -63,7 +63,7 @@ A verbatim interpolated string starts with the `$` character followed by the `@`
6363

6464
There are three implicit conversions from an interpolated string:
6565

66-
1. Conversion of an interpolated string to a <xref:System.String> instance that is the result of interpolated string resolution with interpolated expression items being replaced with the properly formatted string representations of their results. This conversion uses the current culture.
66+
1. Conversion of an interpolated string to a <xref:System.String> instance that is the result of interpolated string resolution with interpolation expression items being replaced with the properly formatted string representations of their results. This conversion uses the current culture.
6767

6868
1. Conversion of an interpolated string to a <xref:System.FormattableString> instance that represents a composite format string along with the expression results to be formatted. That allows you to create multiple result strings with culture-specific content from a single <xref:System.FormattableString> instance. To do that call one of the following methods:
6969

docs/csharp/tutorials/string-interpolation.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ To identify a string literal as an interpolated string, prepend it with the `$`
2121
As the example shows, you include an expression in an interpolated string by enclosing it with braces:
2222

2323
```
24-
{<interpolatedExpression>}
24+
{<interpolationExpression>}
2525
```
2626

2727
Interpolated strings support all the capabilities of the [string composite formatting](../../standard/base-types/composite-formatting.md) feature. That makes them a more readable alternative to the use of the <xref:System.String.Format%2A?displayProperty=nameWithType> method.
2828

29-
## How to specify a format string for an interpolated expression
29+
## How to specify a format string for an interpolation expression
3030

31-
You specify a format string that is supported by the type of the expression result by following the interpolated expression with a colon (":") and the format string:
31+
You specify a format string that is supported by the type of the expression result by following the interpolation expression with a colon (":") and the format string:
3232

3333
```
34-
{<interpolatedExpression>:<formatString>}
34+
{<interpolationExpression>:<formatString>}
3535
```
3636

3737
The following example shows how to specify standard and custom format strings for expressions that produce date and time or numeric results:
@@ -40,20 +40,20 @@ The following example shows how to specify standard and custom format strings fo
4040

4141
For more information, see the [Format String Component](../../standard/base-types/composite-formatting.md#format-string-component) section of the [Composite Formatting](../../standard/base-types/composite-formatting.md) topic. That section provides links to the topics that describe standard and custom format strings supported by .NET base types.
4242

43-
## How to control the field width and alignment of the formatted interpolated expression
43+
## How to control the field width and alignment of the formatted interpolation expression
4444

45-
You specify the minimum field width and the alignment of the formatted expression result by following the interpolated expression with a comma (",") and the constant expression:
45+
You specify the minimum field width and the alignment of the formatted expression result by following the interpolation expression with a comma (",") and the constant expression:
4646

4747
```
48-
{<interpolatedExpression>,<alignment>}
48+
{<interpolationExpression>,<alignment>}
4949
```
5050

5151
If the *alignment* value is positive, the formatted expression result is right-aligned; if negative, it's left-aligned.
5252

5353
If you need to specify both alignment and a format string, start with the alignment component:
5454

5555
```
56-
{<interpolatedExpression>,<alignment>:<formatString>}
56+
{<interpolationExpression>,<alignment>:<formatString>}
5757
```
5858

5959
The following example shows how to specify alignment and uses pipe characters ("|") to delimit text fields:
@@ -76,9 +76,9 @@ The following example shows how to include braces in a result string and constru
7676

7777
[!code-csharp-interactive[escape sequence example](~/samples/snippets/csharp/tutorials/string-interpolation/Program.cs#4)]
7878

79-
## How to use a ternary conditional operator `?:` in an interpolated expression
79+
## How to use a ternary conditional operator `?:` in an interpolation expression
8080

81-
As the colon (":") has special meaning in an item with an interpolated expression, in order to use a [conditional operator](../language-reference/operators/conditional-operator.md) in an expression, enclose it in parentheses, as the following example shows:
81+
As the colon (":") has special meaning in an item with an interpolation expression, in order to use a [conditional operator](../language-reference/operators/conditional-operator.md) in an expression, enclose it in parentheses, as the following example shows:
8282

8383
[!code-csharp-interactive[conditional operator example](~/samples/snippets/csharp/tutorials/string-interpolation/Program.cs#5)]
8484

0 commit comments

Comments
 (0)