如何在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 圣诞祝福语简短小学