the semicolon serves as a line ending, so you can just type breaks, they don't mean anything in c#, the command finishes with the ;
Main Topics
Browse All TopicsI'd like to break a very long string literal across multiple lines in the source code. In VB, this is done with the '_' (underscore) character dangling at the end. How can I do this in C#? I can't seem to find a line continuation character for C#.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
C# sees line breaks as white space, that is, having the same meaning like a space or a tab. Therefore, everywhere where you can add spaces, you can also add line breaks without the need for a line contuinuation character.
Note that you can also span a string across multiple lines when using the literal string prefix:
string str=@"this is a string.
it contains two lines (not just in the source code)!";
Hope this helps.
Well. If you write a literal string, it will also contain the line breaks. This is intentional, as you may have guessed by the contents of that two-line string. If you want to span it without line breaks, use the knowledge that "a"+"b" is the same as "ab" and that you may add any number and any type of whitespace between the string parts and operators (here the + operator):
string str="a"+
"b";
Business Accounts
Answer for Membership
by: WinterMuteUKPosted on 2004-11-08 at 09:00:29ID: 12524997
You could do it like this:
string str =
"thi" +
"s is a string";
admittedly it's not exactly the same.