Stride the scan by pattern.Length (1 for ASCII/UTF-8, 2 for UTF-16, 4 for UTF-32) to avoid matching a misaligned null-terminator pattern mid-character.
Stride the scan by pattern.Length (1 for ASCII/UTF-8, 2 for UTF-16, 4 for UTF-32) to avoid matching a misaligned null-terminator pattern mid-character.