C# C# Basics (Retired) Prepare and Plan Preparation and Planning

Multi-Line Comment in C#

Jeremy wrote several lines of comments using single line comments: the 2 back-slashes // I know each language has it's own syntax for this, but does C# have a multi-line comment, and if so, what is it? Thanks!

4 Answers

anil rahman
anil rahman
7,780 Points
/*
   1st comment 
   2nd comment
   3rd comment
*/
Justin Molyneaux
Justin Molyneaux
12,083 Points

To make a multi-line comment, highlight the lines that you wish to comment and press Command / on Mac or Control / on Windows. Repeat this process to uncomment those lines.

Randy Eichelberger
Randy Eichelberger
445 Points

btw he used multiple single line quotes because each one of these is a separate part of the program. It wouldn't make sense to use a multiline comment when you're about to go through and write code between each line.