S
S
Solomon Gennadievich2021-11-27 13:39:58
C++ / C#
Solomon Gennadievich, 2021-11-27 13:39:58

C# Breaks string. 6 lines are created instead of one. Why can't I move the code to a new line?

I want the code to look like this: the opening quote at the beginning and the closing quote at the end. BUT! The compiler refuses to accept this and instead suggests creating 6 separate lines, and then concatenating them all. Why? What kind of crutch?
61a20a9f19997824630681.png

Here's what Visual Studio offers:
61a20ae7d1a3c702987169.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
ayazer, 2021-11-27
@destroyerkgb

https://docs.microsoft.com/en-us/dotnet/csharp/lan...

var val = 1;
var test = @$"bla {val}
  bla
  bla"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question