I have this:
var s = $"my name is {model.Name}":
and I want the string to be:
"my name is "someone""
How can I do this?
I have this:
var s = $"my name is {model.Name}":
and I want the string to be:
"my name is "someone""
How can I do this?
Simply like you would do without string interpolation:
var s = $"my name is \"{model.Name}\"";
With the string verbatim it gets a little different:
var s = $@"my name is ""{model.Name}""";
You can use double quote escape \"
:
var s = $"my name is \"{model.name}\"";
You can find here and here more character escape sequences available in .NET.