Using C# 8 I have the following test code:
void stringHandling()
{
int nLocalVar = 4;
string filePath = @"C:\src\test\may_not_exist.txt"; // no need to escape anything in this string #CSharpVerbatimLiteralString
// you can have #CSharpInterpolatedString #CSharpVerbatimLiteralString with start of @$ in C# 8, they need to start with $@ in C# 7
string longerVerbatimString = @$"line one uses {nameof(nLocalVar)} which has the value {nLocalVar}
while line two reports the file path is {filePath}
and line three checks the length of the path {filePath.Length}";
}
I need to do this in C# 8 since in C# 7 you have to start the string with $@, not the @$ that you have in your example.
This is what I am seeing, using VS2022 and VA 2476.0. I am testing this correctly aren't I?