Argentini.Halide.H3Xml.Clean C# (CSharp) Метод

Clean() публичный статический Метод

Sanitizes the string for XML use by converting special characters.
public static Clean ( string input ) : String
input string String to process.
Результат String
        public static String Clean(string input)
        {
            string retVal = input;

            try
            {
                if (input == null)
                {
                    retVal = "";
                }

                retVal = H3Text.HtmlEncodeSymbols(retVal);
                retVal = retVal.Replace("&", "&");
                retVal = retVal.Replace("&", "&");

                for (int x = 0; x < retVal.Length; x++)
                {
                    int y = (int)retVal[x];

                    if (y > 122)
                    {
                        retVal = retVal.Remove(x, 1).Insert(x, " ");
                    }
                }

                retVal = retVal.Replace("<", "&lt;");
                retVal = retVal.Replace(">", "&gt;");
                retVal = retVal.Replace("'", "&apos;");
                retVal = retVal.Replace("\"", "&quot;");
            }

            catch (Exception err)
            {
                throw new Exception("Halide.H3Xml Error: " + err.ToString());
            }

            return retVal;
        }