public static char HexUnescape(string pattern, ref int index)
{
if ((index < 0) || (index >= pattern.Length))
{
throw new ArgumentOutOfRangeException(nameof(index));
}
if ((pattern[index] == '%')
&& (pattern.Length - index >= 3))
{
char ret = UriHelper.EscapedAscii(pattern[index + 1], pattern[index + 2]);
if (ret != c_DummyChar)
{
index += 3;
return ret;
}
}
return pattern[index++];
}