private static string GetUnescapeSequence(string str, int index, out int newIndex)
{
int maxCompareLength = str.Length - index;
int iMax = s_escapeStringPairs.Length;
Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
for (int i = 0; i < iMax; i += 2)
{
string strEscSeq = s_escapeStringPairs[i];
string strEscValue = s_escapeStringPairs[i + 1];
int length = strEscValue.Length;
if (length <= maxCompareLength && string.Compare(strEscValue, 0, str, index, length, StringComparison.Ordinal) == 0)
{
newIndex = index + strEscValue.Length;
return strEscSeq;
}
}
newIndex = index + 1;
return str[index].ToString();
}