System.Uri.Unescape C# (CSharp) Method

Unescape() private method

private Unescape ( string path ) : string
path string
return string
        protected virtual string Unescape(string path)
        {
            // This method is dangerous since it gives path unescaping control
            // to the derived class without any permission demand.
            // Should be deprecated and removed asap.

            char[] dest = new char[path.Length];
            int count = 0;
            dest = UriHelper.UnescapeString(path, 0, path.Length, dest, ref count, c_DummyChar, c_DummyChar,
                c_DummyChar, UnescapeMode.Unescape | UnescapeMode.UnescapeAll, null, false);
            return new string(dest, 0, count);
        }

Usage Example

Example #1
0
        private string Format(string s, UriFormat format)
        {
            if (s.Length == 0)
            {
                return(String.Empty);
            }

            switch (format)
            {
            case UriFormat.UriEscaped:
                return(Uri.EscapeString(s, Uri.EscapeCommonHexBrackets));

            case UriFormat.SafeUnescaped:
                return(Uri.UnescapeDataString(s, true));

            case UriFormat.Unescaped:
                return(Uri.Unescape(s, false));

            default:
                throw new ArgumentOutOfRangeException("format");
            }
        }
All Usage Examples Of System.Uri::Unescape