Comments

Two forms of comments are supported: delimited comments and single-line comments.
A delimited comment begins with the characters /* and ends with the characters */. Delimited comments can occupy a portion of a line, a single line, or multiple lines. [Example: The example /* Hello, world program This program writes "hello, world" to the console */ class Hello { static void Main() { System.Console.WriteLine("hello, world"); } } includes a delimited comment. end example]
A single-line comment begins with the characters // and extends to the end of the line. [Example: The example // Hello, world program // This program writes "hello, world" to the console // class Hello // any name will do for this class { static void Main() { // this method must be named "Main" System.Console.WriteLine("hello, world"); } } shows several single-line comments. end example] comment :: single-line-commentdelimited-commentsingle-line-comment :: //input-characters input-characters :: input-characterinput-charactersinput-characterinput-character :: Any Unicode character except a new-line-character new-line-character :: Carriage return character (U+000D) Line feed character (U+000A) Line separator character (U+2028) Paragraph separator character (U+2029) delimited-comment :: /*delimited-comment-characters*/delimited-comment-characters :: delimited-comment-characterdelimited-comment-charactersdelimited-comment-characterdelimited-comment-character :: not-asterisk*not-slashnot-asterisk :: Any Unicode character except * not-slash :: Any Unicode character except /
Comments do not nest. The character sequences /* and */ have no special meaning within a single-line comment, and the character sequences // and /* have no special meaning within a delimited comment.
Comments are not processed within character and string literals.