我得到了关于我的接口(interface)函数的详细描述。
IMyInterface.cs
[Description("Line 1 description content here! Line 2 description content here!Line 3 description content here!Line 4 description content here!Line 5 description content here!Line 6 description content here!")]
void foo()
{
}
如何将单线样式转换为多线样式。谢谢。
[Description("Line 1 description content here!
Line 2 description content here!Line 3 description content here!
Line 4 description content here!Line 5 description content here!
Line 6 description content here!")]
void foo()
{
}
最佳答案
您想使用逐字字符串,只需在您的字符串前加上@:
[Description(@"Line 1 description content here!
Line 2 description content here!
Line 3 description content here!
Line 4 description content here!
Line 5 description content here!
Line 6 description content here!")]
void foo()
{
}
请注意,在这种情况下,从第 2 行开始的缩进将成为字符串的一部分。
关于c# - 如何处理接口(interface)函数的长描述行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2196824/