Ejemplo n.º 1
0
 /// <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));
 }
Ejemplo n.º 2
0
 /// <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));
 }