假设字符串是:Welcome User, Kindly wait for the image to load 对于多行字符串字面量,首先使用 @ 前缀设置如下语句:string str = @"Welcome User, Kindly wait for the image to load"; 现在让我们显示结果。该字符串现在是多行字符串了 示例 在线演示 using System; namespace Demo { class Program { static void Main(string[] args) { string str = @"Welcome User, Kindly wait for the image to load"; Console.WriteLine(str); } } } 输出 Welcome User, Kindly wait for the image to load