Skip to content

Commit 0a60013

Browse files
authored
move string interpolation tutorial (#11646)
* move tutorial Fixes MicrosoftDocs/feedback#1221 The string interpolation tutorial requires more background than the other introductory tutorials. This PR moves those tutorials to the "exploration" section, where readers explore new C# features. * fix build warnings
1 parent 63b10f9 commit 0a60013

File tree

13 files changed

+27
-36
lines changed

13 files changed

+27
-36
lines changed

.openpublishing.redirection.json

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -733,12 +733,12 @@
733733
},
734734
{
735735
"source_path": "docs/csharp/quick-starts/interpolated-strings-local.md",
736-
"redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/interpolated-strings-local",
736+
"redirect_url": "/dotnet/csharp/tutorials/exploration/interpolated-strings-local",
737737
"redirect_document_id": true
738738
},
739739
{
740740
"source_path": "docs/csharp/quick-starts/interpolated-strings.md",
741-
"redirect_url": "/dotnet/csharp/tutorials/intro-to-csharp/interpolated-strings",
741+
"redirect_url": "/dotnet/csharp/tutorials/exploration/interpolated-strings",
742742
"redirect_document_id": true
743743
},
744744
{
@@ -778,6 +778,14 @@
778778
"source_path": "docs/csharp/roslyn/index.md",
779779
"redirect_url": "/dotnet/csharp/roslyn-sdk/"
780780
},
781+
{
782+
"source_path": "docs/csharp/tutorials/intro-to-csharp/interpolated-strings-local.md",
783+
"redirect_url": "/dotnet/csharp/tutorials/exploration/interpolated-strings-local"
784+
},
785+
{
786+
"source_path": "docs/csharp/tutorials/intro-to-csharp/interpolated-strings.yml",
787+
"redirect_url": "/dotnet/csharp/tutorials/exploration/interpolated-strings"
788+
},
781789
{
782790
"source_path": "docs/csharp/tutorials/microservices.md",
783791
"redirect_url": "/dotnet/core/docker/",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The following example uses implicit conversion to <xref:System.FormattableString
8282

8383
## Additional resources
8484

85-
If you are new to string interpolation, see the [String interpolation in C#](../../tutorials/intro-to-csharp/interpolated-strings.yml) interactive tutorial. Or you can try the [String interpolation in C#](../../tutorials/string-interpolation.md) tutorial locally on your machine.
85+
If you are new to string interpolation, see the [String interpolation in C#](../../tutorials/exploration/interpolated-strings.yml) interactive tutorial. Or you can try the [String interpolation in C#](../../tutorials/string-interpolation.md) tutorial locally on your machine.
8686

8787
## See also
8888

docs/csharp/programming-guide/strings/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ A string is an object of type <xref:System.String> whose value is text. Internal
6868
A format string is a string whose contents are determined dynamically at runtime. Format strings are created by embedding *interpolated expressions* or placeholders inside of braces within a string. Everything inside the braces (`{...}`) will be resolved to a value and output as a formatted string at runtime. There are two methods to create format strings: string interpolation and composite formatting.
6969

7070
### String Interpolation
71-
Available in C# 6.0 and later, [*interpolated strings*](../../language-reference/tokens/interpolated.md) are identified by the `$` special character and include interpolated expressions in braces. If you are new to string interpolation, see the [String interpolation - C# interactive tutorial](../../tutorials/intro-to-csharp/interpolated-strings.yml) for a quick overview.
71+
Available in C# 6.0 and later, [*interpolated strings*](../../language-reference/tokens/interpolated.md) are identified by the `$` special character and include interpolated expressions in braces. If you are new to string interpolation, see the [String interpolation - C# interactive tutorial](../../tutorials/exploration/interpolated-strings.yml) for a quick overview.
7272

7373
Use string interpolation to improve the readability and maintainability of your code. String interpolation achieves the same results as the `String.Format` method, but improves ease of use and inline clarity.
7474

docs/csharp/tutorials/intro-to-csharp/interpolated-strings-local.md renamed to docs/csharp/tutorials/exploration/interpolated-strings-local.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.date: 10/23/2018
99

1010
This tutorial teaches you how to use C# [string interpolation](../../language-reference/tokens/interpolated.md) to insert values into a single result string. You write C# code and see the results of compiling and running it. The tutorial contains a series of lessons that show you how to insert values into a string and format those values in different ways.
1111

12-
This tutorial expects that you have a machine you can use for development. The .NET topic [Get Started in 10 minutes](https://www.microsoft.com/net/core) has instructions for setting up your local development environment on Mac, PC or Linux. A quick overview of the commands you'll use is in [introduction to the local tutorials](local-environment.md), with links to more details. You also can complete the [interactive version](interpolated-strings.yml) of this tutorial in your browser.
12+
This tutorial expects that you have a machine you can use for development. The .NET topic [Get Started in 10 minutes](https://www.microsoft.com/net/core) has instructions for setting up your local development environment on Mac, PC or Linux. You also can complete the [interactive version](interpolated-strings.yml) of this tutorial in your browser.
1313

1414
## Create an interpolated string
1515

@@ -161,6 +161,4 @@ The output looks something like the following:
161161

162162
You've completed the string interpolation tutorial.
163163

164-
You can continue with the [List collection](arrays-and-collections.md) tutorial in your own development environment.
165-
166164
For more information, see the [String interpolation](../../language-reference/tokens/interpolated.md) topic and the [String interpolation in C#](../../tutorials/string-interpolation.md) tutorial.

docs/csharp/tutorials/intro-to-csharp/interpolated-strings.yml renamed to docs/csharp/tutorials/exploration/interpolated-strings.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ metadata:
99
level: Beginner
1010
displayType: two-column
1111
interactive: csharp
12-
nextTutorialHref: list-collection.yml
13-
nextTutorialTitle: Collections in C#
1412
items:
1513
- durationInMinutes: 2
1614
content: |

docs/csharp/tutorials/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ different actions. This tutorial is also available
4141
This tutorial assumes that you have finished the [Hello world](intro-to-csharp/hello-world.yml) and
4242
[Numbers in C#](intro-to-csharp/numbers-in-csharp.yml) lessons.
4343

44-
## [String interpolation](intro-to-csharp/interpolated-strings.yml)
45-
46-
The [String interpolation](intro-to-csharp/interpolated-strings.yml) tutorial shows you how to insert values into a string. You'll learn how to create an interpolated string with embedded C# expressions and how to control the text appearance of the expression results in the result string. This tutorial is also available [to run locally on your machine](intro-to-csharp/interpolated-strings-local.md).
47-
4844
## [List collection](intro-to-csharp/list-collection.yml)
4945

5046
The [List collection](intro-to-csharp/list-collection.yml) lesson gives you
@@ -77,3 +73,6 @@ The following tutorials enable you to build C# programs using [.NET Core](../../
7773
* [Inheritance in C# and .NET](inheritance.md): demonstrates inheritance in C#, including the use of inheritance to define base classes, abstract base classes, and derived classes.
7874
* [Working with LINQ](working-with-linq.md): demonstrates many of the features of LINQ and the language elements that support it.
7975
* [Using Attributes](attributes.md): demonstrates how to create and use attributes in C#.
76+
* [String interpolation](exploration/interpolated-strings.yml) tutorial shows you how to insert values into a string. You'll learn how to create an interpolated string with embedded C# expressions and how to control the text appearance of the expression results in the result string. This tutorial is also available [to run locally on your machine](exploration/interpolated-strings-local.md).
77+
78+

docs/csharp/tutorials/intro-to-csharp/branches-and-loops-local.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ Try it yourself. Then check how you did. You should get 63 for an answer. You ca
282282
You've completed the "branches and loops" tutorial.
283283

284284
You can continue with
285-
the [String interpolation](interpolated-strings-local.md) tutorial in
285+
the [Arrays and collections](arrays-and-collections.md) tutorial in
286286
your own development environment.
287287

288288
You can learn more about these concepts in these topics:

docs/csharp/tutorials/intro-to-csharp/branches-and-loops.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ metadata:
99
ms.date: 08/24/2018
1010
displayType: two-column
1111
interactive: csharp
12-
nextTutorialHref: interpolated-strings.yml
13-
nextTutorialTitle: String interpolation in C#
12+
nextTutorialHref: list-collection.yml
13+
nextTutorialTitle: The list collection
1414
items:
1515
- durationInMinutes: 1
1616
content: |

docs/csharp/tutorials/intro-to-csharp/index.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ different actions. This tutorial is also available
4848
This tutorial assumes that you have finished the [Hello world](hello-world.yml) and
4949
[Numbers in C#](numbers-in-csharp.yml) lessons.
5050

51-
## [String interpolation](interpolated-strings.yml)
52-
53-
The [String interpolation](interpolated-strings.yml) tutorial shows you how to insert values into a string. You'll learn how to create an interpolated string with embedded C# expressions and how to control the formatting of the output string. This tutorial is also available [to run locally on your machine](interpolated-strings-local.md).
54-
55-
This tutorial assumes that you have finished the [Hello world](hello-world.yml), [Numbers in C#](numbers-in-csharp.yml), and [Branches and loops](branches-and-loops.yml) lessons.
56-
5751
## [List collection](list-collection.yml)
5852

5953
The [List collection](list-collection.yml) lesson gives you

docs/csharp/tutorials/intro-to-csharp/local-environment.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,6 @@ different actions.
4343
This tutorial assumes that you have finished the [Hello world](hello-world.yml) and
4444
[Numbers in C#](numbers-in-csharp-local.md) lessons.
4545

46-
## [String interpolation](interpolated-strings-local.md)
47-
48-
The [String interpolation](interpolated-strings-local.md) tutorial shows you how to insert values into a string. You'll learn how to create an interpolated string with embedded C# expressions and how to control the formatting of the result string.
49-
50-
This tutorial assumes that you have finished the [Hello world](hello-world.yml), [Numbers in C#](numbers-in-csharp-local.md), and [Branches and loops](branches-and-loops-local.md) lessons.
51-
5246
## [List collection](arrays-and-collections.md)
5347

5448
The [List collection](arrays-and-collections.md) lesson gives you

0 commit comments

Comments
 (0)