BoolStringExtensions extension

Saropa extensions for converting String to bool

on

Methods

toBool() bool

Available on String, provided by the BoolStringExtensions extension

Converts a case-insensitive string of 'true' to a boolean. Returns false if the string is not 'true'.
toBoolNullable() bool?

Available on String, provided by the BoolStringExtensions extension

Converts a case-insensitive string of 'true' or 'false' to a boolean. Returns null if the string is empty or not 'true' or 'false'.