private unsafe static char* MatchChars(char* p, char* str)
{
Debug.Assert(p != null && str != null);
if (*str == '\0')
{
return null;
}
// We only hurt the failure case
// This fix is for French or Kazakh cultures. Since a user cannot type 0xA0 as a
// space character we use 0x20 space character instead to mean the same.
while (*p == *str || (*str == '\u00a0' && *p == '\u0020'))
{
p++;
str++;
if (*str == '\0') return p;
}
return null;
}