convert

fun convert(stringBoolean: String): Boolean

Converts various strings to booleans, by using regex, to allow for more variations in input.

Converted to TRUE are:

  • [Tt]rue

  • 1

  • [Yy]es

  • [Yy]

  • Language Key cli.input.true

  • Language Key cli.input.yes

  • Language Key cli.input.yes.short

Converted to FALSE are:

  • [Ff]alse

  • 0

  • [Nn]o

  • [Nn]

  • Language Key cli.input.false

  • Language Key cli.input.no

  • Language Key cli.input.no.short

Return

Returns the corresponding boolean if match with pattern was found. If no match is found, assume and return false.

Author

Griefed

Parameters

stringBoolean

The string which should be converted to boolean if it matches certain patterns.