views:

43

answers:

1

Hi, I got a long description for my interface function.

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()
{
}

How to convert the single line to multi lines style. thanks.

[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()
{
}
+4  A: 

You want to use a verbatim string, just preppend @ to your string:

[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() 
{ 
} 

Note that the indentations starting on line 2 will be part of your string in this case.

Jordão
Hi Jordao, With your help, I googled **@** and found: C# has another type of string -- the string literal (@"")... Thanks.
Nano HE