How to use escape characters with string interpolation in C# 6?
问题 I've been using string interpolation and loving it, however I have an issue where I am trying to include a backslash in my output, but am not able to get it to work. What I want is something like this.. var domain = "mydomain"; var userName = "myUserName"; var combo = $"{domain}\{userName}" I want the output of combo to be myDomain\myUserName What I am getting is a syntax error about the \ being an escape character. If I put in \\ then the snytax error is gone, but the output is myDomain\