rspec/rules/S6610/why-dotnet.adoc

6 lines
424 B
Plaintext

== Why is this an issue?
With `string.StartsWith(char)` and `string.EndsWith(char)`, only the first character of the string is compared to the provided character, whereas the `string` versions of those methods have to do checks about the current `StringComparison` and `CultureInfo`. Thus, the `char` overloads are significantly faster for default comparison scenarios.
These overloads were introduced in `.NET Core 2.0`.