Multiline string literal in C#

后端 未结 13 1801
梦谈多话
梦谈多话 2020-11-22 11:15

Is there an easy way to create a multiline string literal in C#?

Here\'s what I have now:

string query = \"SELECT foo, bar\"
+ \" FROM table\"
+ \" W         


        
13条回答
  •  刺人心
    刺人心 (楼主)
    2020-11-22 11:33

    As a side-note, with C# 6.0 you can now combine interpolated strings with the verbatim string literal:

    string camlCondition = $@"
    
        
            
            {(string)parameter}
        
    ";
    

提交回复
热议问题