Skip to content

Commit 4396866

Browse files
authored
Update csrefKeywordsModifiers.cs (#45803)
Added '$' in two locations to enable string interpolation.
1 parent c29a91a commit 4396866

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

samples/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsModifiers/CS/csrefKeywordsModifiers.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ public abstract class Shape
785785
protected Shape(string color)
786786
{
787787
Color = color;
788-
Console.WriteLine("Created a shape with color {color}.");
788+
Console.WriteLine($"Created a shape with color {color}.");
789789
}
790790

791791
// Abstract method that must be implemented by derived classes
@@ -813,7 +813,7 @@ public class Program
813813
public static void Main(string[] args)
814814
{
815815
Square square = new Square("red", 5);
816-
Console.WriteLine("Area of the square: {square.CalculateArea()}");
816+
Console.WriteLine($"Area of the square: {square.CalculateArea()}");
817817
}
818818
}
819819
//</snippet27>

0 commit comments

Comments
 (0)