Finder.Areas.HelpPage.HelpPageSampleGenerator.TryFormatXml C# (CSharp) Method

TryFormatXml() private method

private TryFormatXml ( string str ) : string
str string
return string
        private static string TryFormatXml(string str)
        {
            try
            {
                XDocument xml = XDocument.Parse(str);
                return xml.ToString();
            }
            catch
            {
                // can't parse XML, return the original string
                return str;
            }
        }