static private AppendDecoded ( StringBuilder builder, string s, int index ) : void | ||
builder | StringBuilder | /// The string under construction to which the decoded character will be /// appended. /// |
s | string | The string being decoded. |
index | int | The index of the '%' character in the string. |
return | void |
static void AppendDecoded(StringBuilder builder, string s, int index)
{
if (index > s.Length - 3)
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
"Invalid percent-encoded string '{0}'",
s));
var first = s[index + 1];
var second = s[index + 2];
var decoded = (char) (FromHex(first) << 4 | FromHex(second));
builder.Append(decoded);
}