如何在C#中定义多行字符串文字?
假设字符串为-
Welcome User, Kindly wait for the image to load
对于多行StringLiteral,首先使用@前缀将其设置为以下语句,如下所示:
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
热门推荐
10 八一幼儿祝福语大全简短
11 公司乔迁食堂祝福语简短
12 婚礼结束聚餐祝福语简短
13 儿媳买车妈妈祝福语简短
14 毕业送礼老师祝福语简短
15 同事辞职正常祝福语简短
16 恭贺新婚文案祝福语简短
17 金店立秋祝福语简短英文
18 婆婆高寿祝福语大全简短