I want to define a long string and use it as a parameter in a helper class.
I have the following code which does not compile
@{
var code ="
new TEL_Helper
{
URI = "abc@domain.com",
Type = TEL_TelecomType.Email,
Use = TEL_TelecomUse.VacationHome
}"
Html.SyntaxXML(code)
}
How do I define the string that spans multiple lines and has line breaks.
and the solution I used was :
@{
var code =@"
new TEL_Helper
{
URI = 'abc@domain.com',
Type = TEL_TelecomType.Email,
Use = TEL_TelecomUse.VacationHome
}";
Html.SyntaxXML(code);
}
You’re looking for the standard C# verbatim string literal.