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
2 changes: 1 addition & 1 deletion docs/core/windows-prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ See [.NET Core 1.x Supported OS Versions](https://github.com/dotnet/core/blob/ma

> [!NOTE]
> *For Windows 8.1 and earlier versions, or Windows Server 2012 R2 and earlier versions:*
> Make sure that your Windows installation is up-to-date and includes [KB2999226](https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows) which can be installed through Windows Update. If you don't have this update installed, you'll see an error when you launch a .NET Core application like the following: `The program can't start because api-ms-win-crt-runtime-1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.`.
> Make sure that your Windows installation is up-to-date and includes [KB2999226](https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows) which can be installed through Windows Update. If you don't have this update installed, you'll see an error when you launch a .NET Core application like the following: `The program can't start because api-ms-win-crt-runtime-1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem.`

## Prerequisites with Visual Studio 2017

Expand Down
6 changes: 3 additions & 3 deletions docs/csharp/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ There are several sections in the C# Guide. You can read them in order, or jump
* [Tour of C#](tour-of-csharp/index.md)
* This section provides an overview of the language. It covers the elements that make up C# programs and the capabilities of the language. It shows small samples of all the syntax elements of C# and discussions of the major C# language topics.

* [Latest Features](whats-new/index.md)
* Learn about new features in the language. Learn about new tools like C# Interactive (C#'s REPL), and the .NET Compiler Platform SDK. This section shows how the language is evolving and how the new tools can make you more productive.
* [What's new in C#](whats-new/index.md)
* Provides overviews of new features added in the latest language releases and of the history of the C# language.

<!--
* [.NET Compiler Platform SDK](roslyn-sdk/index.md)
Expand All @@ -64,4 +64,4 @@ There are several sections in the C# Guide. You can read them in order, or jump

[Getting Started with Visual C# and Visual Basic](/visualstudio/ide/getting-started-with-visual-csharp-and-visual-basic)
[.NET Development](https://msdn.microsoft.com/library/ff361664)
[C# Samples](http://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=ProgrammingLanguage&f%5B0%5D.Value=C%23&f%5B0%5D.Text=C%23)
[C# Samples](http://code.msdn.microsoft.com/site/search?f%5B0%5D.Type=ProgrammingLanguage&f%5B0%5D.Value=C%23&f%5B0%5D.Text=C%23)
12 changes: 6 additions & 6 deletions docs/csharp/language-reference/tokens/interpolated.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ ms.author: ronpet
---
# $ - string interpolation (C# Reference)

The `$` special character identifies a string literal as an *interpolated string*. An interpolated string is a string literal that might contain *interpolated expressions*. When the interpolated string is resolved to the 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.
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.

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:

[!code-csharp-interactive[compare with composite formatting](../../../../samples/snippets/csharp/language-reference/tokens/string-interpolation.cs#1)]

## Structure of an interpolated string

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 the string. Doing so causes a compile-time error.
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.

The structure of an item with an interpolated expression is as follows:

```
{<interpolatedExpression>[,<alignment>][:<formatString>]}
```

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

|Element|Description|
|-------------|-----------------|
Expand All @@ -49,11 +49,11 @@ To include a brace, "{" or "}", in the text produced by an interpolated string,

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.

The following example shows how to include a brace into the result string and how to use a conditional operator in an interpolated expression:
The following example shows how to include a brace in a result string and how to use a conditional operator in an interpolated expression:

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

Verbatim interpolated strings use the `$` character followed by the `@` character. For more information about verbatim strings, see the [string](../keywords/string.md) topic.
A verbatim interpolated string starts with the `$` character followed by the `@` character. For more information about verbatim strings, see the [string](../keywords/string.md) and [verbatim identifier](verbatim.md) topics.

> [!NOTE]
> The `$` token must appear before the `@` token in a verbatim interpolated string.
Expand All @@ -80,7 +80,7 @@ The following example uses implicit conversion to <xref:System.FormattableString

## Additional resources

If you are new to the string interpolation, see the [String interpolation in C#](../../quick-starts/interpolated-strings.yml) quickstart. For more examples, see the [String interpolation in C#](../../tutorials/string-interpolation.md) tutorial.
If you are new to string interpolation, see the [String interpolation in C#](../../quick-starts/interpolated-strings.yml) quickstart. For more examples, see the [String interpolation in C#](../../tutorials/string-interpolation.md) tutorial.

## See also
<xref:System.String.Format%2A?displayProperty=nameWithType>
Expand Down
2 changes: 1 addition & 1 deletion docs/csharp/tour-of-csharp/structs.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ An alternative is to make Point a struct.

Now, only one object is instantiated—the one for the array—and the `Point` instances are stored in-line in the array.

Struct constructors are invoked with the new operator, but that does not imply that memory is being allocated. Instead of dynamically allocating an object and returning a reference to it, a struct constructor simply returns the struct value itself (typically in a temporary location on the stack), and this value is then copied as necessary.
Struct constructors are invoked with the `new` operator, but that does not imply that memory is being allocated. Instead of dynamically allocating an object and returning a reference to it, a struct constructor simply returns the struct value itself (typically in a temporary location on the stack), and this value is then copied as necessary.

With classes, it is possible for two variables to reference the same object and thus possible for operations on one variable to affect the object referenced by the other variable. With structs, the variables each have their own copy of the data, and it is not possible for operations on one to affect the other. For example, the output produced by the following code fragment depends on whether Point is a class or a struct.

Expand Down
8 changes: 4 additions & 4 deletions docs/csharp/tutorials/string-interpolation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: String interpolation in C#
description: Learn how to include formatted expression results into a result string in C# with string interpolation.
description: Learn how to include formatted expression results in a result string in C# with string interpolation.
author: pkulikov
ms.date: 05/09/2018
---
Expand All @@ -18,7 +18,7 @@ To identify a string literal as an interpolated string, prepend it with the `$`

[!code-csharp-interactive[string interpolation example](~/samples/snippets/csharp/tutorials/string-interpolation/Program.cs#1)]

As the example above shows, you include an expression in an interpolated string by enclosing it with braces:
As the example shows, you include an expression in an interpolated string by enclosing it with braces:

```
{<interpolatedExpression>}
Expand Down Expand Up @@ -60,7 +60,7 @@ The following example shows how to specify alignment and uses pipe characters ("

[!code-csharp-interactive[alignment example](~/samples/snippets/csharp/tutorials/string-interpolation/Program.cs#3)]

As the example output shows, if the length of formatted expression result exceeds specified field width, the *alignment* value is ignored.
As the example output shows, if the length of the formatted expression result exceeds specified field width, the *alignment* value is ignored.

For more information, see the [Alignment Component](../../standard/base-types/composite-formatting.md#alignment-component) section of the [Composite Formatting](../../standard/base-types/composite-formatting.md) topic.

Expand Down Expand Up @@ -92,7 +92,7 @@ As the example shows, you can use one <xref:System.FormattableString> instance t

## How to create a result string using the invariant culture

Along with the <xref:System.FormattableString.ToString(System.IFormatProvider)?displayProperty=nameWithType> method, you can use the static <xref:System.FormattableString.Invariant%2A?displayProperty=nameWithType> method to resolve an interpolated string into a result string for the <xref:System.Globalization.CultureInfo.InvariantCulture>. The following example shows how to do that:
Along with the <xref:System.FormattableString.ToString(System.IFormatProvider)?displayProperty=nameWithType> method, you can use the static <xref:System.FormattableString.Invariant%2A?displayProperty=nameWithType> method to resolve an interpolated string to a result string for the <xref:System.Globalization.CultureInfo.InvariantCulture>. The following example shows how to do that:

[!code-csharp-interactive[format with invariant culture](~/samples/snippets/csharp/tutorials/string-interpolation/Program.cs#7)]

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/configure-apps/file-schema/wcf/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `service` element contains the settings for a Windows Communication Foundati

```xml
<service behaviorConfiguration=String"
name="String"
name="String">
</service>
```

Expand Down
4 changes: 3 additions & 1 deletion docs/fsharp/language-reference/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ms.date: 05/16/2016
```fsharp
// Interface declaration:
[ attributes ]
type interface-name =
type [accessibility-modifier] interface-name =
[ interface ] [ inherit base-interface-name ...]
abstract member1 : [ argument-types1 -> ] return-type1
abstract member2 : [ argument-types2 -> ] return-type2
Expand All @@ -38,6 +38,8 @@ let class-name (argument-list) =
## Remarks
Interface declarations resemble class declarations except that no members are implemented. Instead, all the members are abstract, as indicated by the keyword `abstract`. You do not provide a method body for abstract methods. However, you can provide a default implementation by also including a separate definition of the member as a method together with the `default` keyword. Doing so is equivalent to creating a virtual method in a base class in other .NET languages. Such a virtual method can be overridden in classes that implement the interface.

The default accessibility for interfaces is `public`.

You can optionally give each method parameter a name using normal F# syntax:

[!code-fsharp[Main](../../../samples/snippets/fsharp/lang-ref-1/snippet24032.fs)]
Expand Down
4 changes: 3 additions & 1 deletion docs/fsharp/language-reference/type-abbreviations.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ A *type abbreviation* is an alias or alternate name for a type.
## Syntax

```fsharp
type type-abbreviation = type-name
type [accessibility-modifier] type-abbreviation = type-name
```

## Remarks
You can use type abbreviations to give a type a more meaningful name, in order to make code easier to read. You can also use them to create an easy to use name for a type that is otherwise cumbersome to write out. Additionally, you can use type abbreviations to make it easier to change an underlying type without changing all the code that uses the type. The following is a simple type abbreviation.

Accessibility of type abbreviations defaults to `public`.

[!code-fsharp[Main](../../../samples/snippets/fsharp/lang-ref-1/snippet2301.fs)]

Type abbreviations can include generic parameters, as in the following code.
Expand Down
4 changes: 2 additions & 2 deletions docs/machine-learning/tutorials/taxi-fare.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ Next, create classes for the input data and the predictions:

Add two classes into this file. `TaxiTrip`, the input data set class, has definitions for each of the columns discovered above and a `Label` attribute for the fare_amount column that you are predicting. Add the following code to the file:

[!code-csharp[DefineTaxiTrip](../../../samples/machine-learning/tutorials/TaxiFarePrediction/Program.cs#2 "Define the taxi trip class")]
[!code-csharp[DefineTaxiTrip](../../../samples/machine-learning/tutorials/TaxiFarePrediction/TaxiTrip.cs#2 "Define the taxi trip class")]

The `TaxiTripFarePrediction` class is used for prediction after the model has been trained. It has a single float (fare_amount) and a `Score` `ColumnName` attribute. Add the following code into the file below the `TaxiTrip` class:

[!code-csharp[DefineFarePrediction](../../../samples/machine-learning/tutorials/TaxiFarePrediction/Program.cs#3 "Define the fare predictions class")]
[!code-csharp[DefineFarePrediction](../../../samples/machine-learning/tutorials/TaxiFarePrediction/TaxiTrip.cs#3 "Define the fare predictions class")]

Now go back to the **Program.cs** file. In `Main`, replace the `Console.WriteLine("Hello World!")` with the following code:

Expand Down
Loading