I am trying to implement some of the features in this video but I'm not having much luck with the new String Interpolation syntax (I have everything else working, at least that's in this code).
I am using Visual Studio 2015 CTP6, I have configured it to use .NET 4.6 and have gone into the Build options to make sure I was specifying C# 6.0. I have also followed the instructions here.
Here is my code:
using System;
using static System.Math;
namespace NewCsharp6Features
{
public class C6Point
{
public int X { get; }
public int Y { get; }
public double Distance => Sqrt(X * X + Y * Y);
public C6Point(int x, int y) { X = x; Y = y; }
public override string ToString()
{
return "(\{X}, \{Y})";
}
}
}
I am getting two of this compilation error:
CS1009 | Unrecognized escape sequence
Any idea what I'm doing wrong, here?
The 2022 C-Class sedan starts at $43,550. The midtier Exclusive model starts at $45,800, and the top Pinnacle trim has a starting MSRP of $47,500. All-wheel drive is available in all models for an additional $2,000.
Mercedes-Benz's entry-level sports sedan has been thoroughly redesigned for the 2022 model year but the C-class sticks with its winning formula of luxury and prestige at an affordable price. The modernization gives the C-class what it needs to better battle rivals such as the Audi A4, BMW 3-series, and Genesis G70.
A super duper car with full of comfort with excellent steering. The Mercedes benz ranks 4 out of 20 in luxury cars.
Mercedes-Benz C Class C180 AMG Line 4dr Auto Reviews 2022 | Top Gear.
You need to proceed the string with a $
public override string ToString()
{
return $"({X}, {Y})";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With