Babel.Core.BOOL.from_str C# (CSharp) Method

from_str() public static method

public static from_str ( bool self, string s ) : bool
self bool
s string
return bool
        public static bool from_str(bool self, string s)
        {
            if (s == "true" || s == "t" ||
                s == "True" || s == "T" ||
                s == "TRUE") {
                return true;
            }
            else if (s == "false" || s == "f" ||
                     s == "False" || s == "F" ||
                     s == "FALSE") {
                return false;
            }
            else {
                throw new Exception("can't interpret bool value: " + s);
            }
        }