hello there,
I'm relatively new to C#. I have to define a veeeeery long constant string and when I try to run an aspx page (Framework 1.1) containing this line of code:
I get a compilation error CS1034Code:private const string longString = "believe me this is very long [...]";
"Compiler limit exceeded: Line cannot exceed 2046 characters"
Now, the MSDN isn't helping, it's just displaying this
Do you know if there is any workaround to make it compile besides splitting the string into n pieces for subsequent concats into a variable? I'd really like to use a constant, this limitation is just silly if you ask me, expecially becuase if I had used VB.net I would have not encountered this problem.
Also, do you know if C# can use its own version of that useful Vb.net underscore feature that make long lines more readable?
Many thanks in advanceCode:Const longString As String = "abcdefg" & _ "hijklmnopq" & _ "rstuvwxyz012...."![]()




Reply With Quote