I've been using string interpolation and love it. However, I have an issue where I am trying to include a backslash in my output, but I am not able to get it to work.
I want something like this...
var domain = "mydomain";
var userName = "myUserName";
var combo = $"{domain}{userName}"
I want the output of combo to be:
myDomainmyUserName
I get a syntax error about the being an escape character. If I put in \ then the syntax error is gone, but the output is myDomain\myUsername.
How can I include escaped characters in an interpolated string?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…