Share via


SyntaxFactory.Comment(String) Method

Definition

Creates a trivia with kind either SingleLineCommentTrivia or MultiLineCommentTrivia containing the specified text.

public:
 static Microsoft::CodeAnalysis::SyntaxTrivia Comment(System::String ^ text);
public static Microsoft.CodeAnalysis.SyntaxTrivia Comment (string text);
static member Comment : string -> Microsoft.CodeAnalysis.SyntaxTrivia
Public Shared Function Comment (text As String) As SyntaxTrivia

Parameters

text
String

The entire text of the comment including the leading '//' token for single line comments or stop or start tokens for multiline comments.

Returns

Applies to