Escaping Quotes inside new C# 6 String Syntax
I'm really excited about the new features in C# 6, including the new string syntax: var fullName = $"My Name is {FirstName} {LastName}"; However, I can't figure out how to escape quotes inside the braces to do the follow: bool includePrefix = true; var fullName = $"My name is {includePrefix ? "Mr. " : ""}{FirstName} {LastName}"; C# 6 doesn't like that. I've had to revert to using String.Format in that second case. Is it possible to escape quotes using the new syntax? Update: Yes, I have tried using the \ escape, but it's not recognized. wrap your logic inside parentheses, inside the brackets: