c和代码标签之间的区别

Pan*_*kaj 1 c# xml-comments

在C#xml注释中,下面的标签有什么区别?

1. <c> 
2. <code>
Run Code Online (Sandbox Code Playgroud)

Pao*_*sco 5

假设您正在讨论xml注释中的标记,c就像StackOverflow中的反向标记,而code更像是代码块.

/// <summary>
/// This is the <c>SomeMethod</c> method of the <c>Program</c> class.
/// </summary>
/// <param name="s">A string.</param>
/// <example>
/// You can use this method like this:
/// <code>
/// string x = SomeMethod("foobar");
/// Console.WriteLine(x);
/// </code>
/// </example>
static string SomeMethod(string s){
    throw new NotImplementedException();
} 
Run Code Online (Sandbox Code Playgroud)