toBooleanOrNull

Returns content as boolean only if content is "true" or "false", otherwise null.