Have Multiline Strings in VS

I frequently face situation where a string variable has a long length, so long that I have to scroll the screen left to right to see it.  What helps in this situation is to have breaks in that string so that the full string can be seen without having to scroll left-right.

Using “@” before the string’s value helps in this case.  For example,

string mysql = "select table1.col1,table1.col2,table1.col3, table2.column3, table2.col4, table2.col4 from table1 join table2 on table1.col1 = table2.col2"

can be written as:

string mysql = @"select table1.col1,table1.col2,table1.col3
, table2.column3, table2.col4, table2.col4
from table1 join table2
on table1.col1 = table2.col2"
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s