Function stob (o2scl)¶
-
bool o2scl::stob(std::string s, bool err_on_fail = true)¶
Convert a string to a boolean value.
This returns true if only if the string has at least one character and the first non-whitespace character is either
t
,T
, or one of the numbers 1 through 9.If
err_on_fail
is true and the conversion fails, this function calls the error handler, otherwise this function just returns false.