System.Xml.XmlConvert.TryToBoolean C# (CSharp) Méthode

TryToBoolean() static private méthode

static private TryToBoolean ( string s, System.Boolean &result ) : Exception
s string
result System.Boolean
Résultat System.Exception
        internal static Exception TryToBoolean(string s, out Boolean result)
        {
            s = TrimString(s);
            if (s == "0" || s == "false")
            {
                result = false;
                return null;
            }
            else if (s == "1" || s == "true")
            {
                result = true;
                return null;
            }
            result = false;
            return new FormatException(SR.Format(SR.XmlConvert_BadFormat, s, "Boolean"));
        }