From 7e5016eb85ec42facd1ffb7bdc9d0a9645f4b9f0 Mon Sep 17 00:00:00 2001 From: Ron Petrusha Date: Tue, 22 May 2018 11:13:57 -0700 Subject: [PATCH] Addressed issue 42 in dotnet/try repo --- docs/csharp/quick-starts/interpolated-strings-local.md | 2 +- docs/csharp/quick-starts/interpolated-strings.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/csharp/quick-starts/interpolated-strings-local.md b/docs/csharp/quick-starts/interpolated-strings-local.md index 0ccbbb0f7c6a0..5ea4ca4b87baa 100644 --- a/docs/csharp/quick-starts/interpolated-strings-local.md +++ b/docs/csharp/quick-starts/interpolated-strings-local.md @@ -88,7 +88,7 @@ Note that the interpolated expression `item` in the interpolated string resolves - If the interpolated expression evaluates to `null`, an empty string ("", or ) is used. -- If the interpolated expression doesn't evaluate to `null`, typically the `ToString` method of the result type is called. You can test this by updating the implementation of the `Vegetable.ToString` method. You might even not implement `ToString` method since every C# data type has some implementation of this method. To test that, comment out the definition of the `Vegetable.ToString` method in the example (to do that, put a comment symbol `//` in front of it). In the output, the string "eggplant" is replaced by the fully qualified type name ("Vegetable" in this example), which is the default behavior of the method. Default behavior of the `ToString` method for an enumeration type is to return the string representation of a value used at the definition of the enumeration. +- If the interpolated expression doesn't evaluate to `null`, typically the `ToString` method of the result type is called. You can test this by updating the implementation of the `Vegetable.ToString` method. You might not even need to implement the `ToString` method since every type has some implementation of this method. To test this, comment out the definition of the `Vegetable.ToString` method in the example (to do that, put a comment symbol, `//`, in front of it). In the output, the string "eggplant" is replaced by the fully qualified type name ("Vegetable" in this example), which is the default behavior of the method. The default behavior of the `ToString` method for an enumeration value is to return the string representation of the value. In the output from this example, the date is too precise (the price of eggplant doesn't change every second), and the price value doesn't indicate a unit of currency. In the next section, you'll learn how to fix those issues by controlling the format of string representations of the expression results. diff --git a/docs/csharp/quick-starts/interpolated-strings.yml b/docs/csharp/quick-starts/interpolated-strings.yml index b31effb20d0b3..b07bb3639447a 100644 --- a/docs/csharp/quick-starts/interpolated-strings.yml +++ b/docs/csharp/quick-starts/interpolated-strings.yml @@ -68,7 +68,7 @@ items: - If the interpolated expression evaluates to `null`, an empty string ("", or ) is used. - - If the interpolated expression doesn't evaluate to `null`, typically the `ToString` method of the result type is called. You can test this by updating the implementation of the `Vegetable.ToString` method. You might even not implement `ToString` method since every C# data type has some implementation of this method. To test that, comment out the definition of the `Vegetable.ToString` method in the example (to do that, put a comment symbol `//` in front of it). In the output, the string "eggplant" is replaced by the fully qualified type name (the namespace defined by the C# REPL along with the type name), which is the default behavior of the method. Default behavior of the `ToString` method for an enumeration type is to return the string representation of a value used at the definition of the enumeration. + - If the interpolated expression doesn't evaluate to `null`, typically the `ToString` method of the result type is called. You can test this by updating the implementation of the `Vegetable.ToString` method. You might not even need to implement the `ToString` method since every type has some implementation of this method. To test this, comment out the definition of the `Vegetable.ToString` method in the example (to do that, put a comment symbol, `//`, in front of it). In the output, the string "eggplant" is replaced by the fully qualified type name (the namespace defined by the C# REPL along with the type name), which is the default behavior of the method. The default behavior of the `ToString` method for an enumeration value is to return the string representation of the value. In the output from this example, the date is too precise (the price of eggplant doesn't change every second), and the price value doesn't indicate a unit of currency. In the next step, you'll learn how to fix those issues by controlling the format of string representations of the expression results.