System.Net.ProxyRegBlob.BypassStringEscape C# (CSharp) Method

BypassStringEscape() private static method

private static BypassStringEscape ( string bypassString ) : string
bypassString string
return string
        private static string BypassStringEscape(string bypassString) {
            StringBuilder escapedBypass = new StringBuilder();
            // (\, *, +, ?, |, {, [, (,), ^, $, ., #, and whitespace) are reserved
            foreach (char c in bypassString){
                if (c == '\\' || c == '.' || c == '?' || c == '(' || c == ')' || c == '|' || c == '^' || c == '+' ||
                    c == '{' || c == '[' || c == '$' || c == '#')
                {
                    escapedBypass.Append('\\');
                }
                else if (c == '*') {
                    escapedBypass.Append('.');
                }
                escapedBypass.Append(c);
            }
            escapedBypass.Append('$');
            return escapedBypass.ToString();
        }