C#中的多行字符串文字 - Multiline string literal in C#

問題:

Is there an easy way to create a multiline string literal in C#? 有沒有一種簡單的方法能夠在C#中建立多行字符串文字? spa

Here's what I have now: 這是我如今所擁有的: .net

string query = "SELECT foo, bar"
+ " FROM table"
+ " WHERE id = 42";

I know PHP has 我知道PHP有 code

<<<BLOCK

BLOCK;

Does C# have something similar? C#是否有相似的東西? 字符串


解決方案:

參考一: https://stackoom.com/question/4cE8/C-中的多行字符串文字
參考二: https://oldbug.net/q/4cE8/Multiline-string-literal-in-C
相關文章
相關標籤/搜索