Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 348 Bytes

MA0089.md

File metadata and controls

16 lines (12 loc) · 348 Bytes

MA0089 - Optimize string method usage

string str;
str.StartsWith("a"); // non-compliant
str.StartsWith('a'); // ok

str.EndsWith("a"); // non-compliant
str.EndsWith('a'); // ok

str.Replace("a", "b"); // non-compliant
str.Replace('a', 'b'); // ok

str.IndexOf("a", StringComparison.Ordinal); // non-compliant
str.IndexOf('a'); // ok