SA1011 - Visual-Stylecop/Visual-StyleCop GitHub Wiki

<title>SA1011: ClosingSquareBracketsMustBeSpacedCorrectly</title> <script src="script/helpstudio.js" type="text/javascript"></script> <script src="script/StandardText.js" type="text/jscript"></script>
<script type="text/jscript">WritePageTop(document.title);</script>

TypeName

ClosingSquareBracketsMustBeSpacedCorrectly

CheckId

SA1011

Category

Spacing Rules

Cause

A closing square bracket within a C# statement is not spaced correctly.

Rule Description

A violation of this rule occurs when the spacing around a closing square bracket is not correct.

A closing square bracket must never be preceded by whitespace, unless it is the first character on the line.

Aclosing square bracket must be followed by whitespace, unless it is the last character on the line, it is followed by a closing bracket or an opening parenthesis, it is followed by a comma or semicolon, or it is followed by certain types of operator symbols.

How to Fix Violations

To fix a violation of this rule, ensure that the spacing around the closing square bracket follows the rule described above.

How to Suppress Violations

[SuppressMessage("StyleCop.CSharp.SpacingRules", "SA1011:ClosingSquareBracketsMustBeSpacedCorrectly", Justification = "Reviewed.")]
    </div>
</body>
⚠️ **GitHub.com Fallback** ⚠️