5
Answers

Line break in c#

Max Tenenbaum

Max Tenenbaum

13y
3k
1
Hi,

I am working on a condition statement with a very long opening if statement and this requires me to keep scrolling right. How can I break onto a new line so my code is easier to read but without breaking the string?

e.g.

         if (ThisUser.Company == "MyCompany" || ThisUser.Company == "MyCompany2" || ThisUser.Company == "MyCompany3" || ThisUser.Company == "MyCompany4" || ThisUser.Company == "MyCompany2")
        {
            Logo.ImageUrl = "../Images/Logo.png";
        }

Thanks

M
Answers (5)