Gendarme.Rules.Performance.UseStringEmptyRule Class
This rule checks for methods that are using the literal "" instead of the String.Empty field. You'll get slighly better performance by using String.Empty. Note that in some cases, e.g. in a switch/case statement, you cannot use a field, so "" must be used instead of String.Empty.

See Also: UseStringEmptyRule Members

Syntax

[Gendarme.Framework.EngineDependency(typeof(Gendarme.Framework.Engines.OpCodeEngine, Gendarme.Framework, Version=2.8.0.0, Culture=neutral, PublicKeyToken=null))]
[Gendarme.Framework.Problem("The method uses literal "" instead of String.Empty.")]
[Gendarme.Framework.Solution("Replace the empty string literal with String.Empty.")]
public class UseStringEmptyRule : Gendarme.Framework.Rule, Gendarme.Framework.IMethodRule

Remarks

Documentation for this section has not yet been entered.

Example

Bad example:

Example

            string s = "";
            

Example

Good example:

Example

            string s = String.Empty;
            

Requirements

Namespace: Gendarme.Rules.Performance
Assembly: Gendarme.Rules.Performance (in Gendarme.Rules.Performance.dll)
Assembly Versions: 2.8.0.0