/// <summary> /// Converts the string value to a boolean value. /// </summary> /// <param name="_string">The string to convert.</param> /// <param name="defaultValue">Default value to return if the conversion fails.</param> /// <returns> For strings beginning with y or t (yes, true, TRUE, YES, etc) or just the value 1, true is returned. All other strings return false.</returns> public static bool ToBool(this string _string, bool defaultValue) { return(StringConverters._ToBool(_string, true, defaultValue)); }
/// <summary> /// Converts the string value to a boolean value. /// </summary> /// <param name="_bool">The string to convert.</param> /// <returns> For strings beginning with y or t (yes, true, TRUE, YES, etc) or just the value 1, true is returned. All other strings return false.</returns> public static bool ToBool(this string _string) { return(StringConverters._ToBool(_string, false, false)); }