Adding a string to the verbatim string literal

前端 未结 3 824
天涯浪人
天涯浪人 2021-01-05 01:20

I have a path that is named defaultPath I want to add it into this verbatim string literal but can quite get the quotes around it.

    @\"\"\"C:\\Mavro\\Mav         


        
3条回答
  •  一个人的身影
    2021-01-05 01:45

    So if you would like to take advantage of the string interpolation with c# 6 you could also do

    var randomText = "insert something";
    var yourString = $@"A bunch of text in here 
    that is on seperate lines
    but you want to {randomText }";
    

提交回复
热议问题