Code inspection: Replace 'SequenceEqual' with constant pattern

Last modified: 08 May 2024

If you deal with parsing of character spans, you probably use MemoryExtensions.SequenceEqual method a lot. C# 11 introduces a shorthand for this kind of checks, enabling you to simply pattern-match spans of characters against string literals with is or switch expressions.

This inspection reports usages of SequenceEqual() in such contexts and helps you upgrade to a more concise syntax.