toBoolean

@DeprecatedSinceKotlin(hiddenSince = "1.4")
fun String.toBoolean(): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
inline fun String.toBoolean(): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
inline fun String.toBoolean(): Boolean
@DeprecatedSinceKotlin(hiddenSince = "1.4")
inline fun String.toBoolean(): Boolean

Returns true if the content of this string is equal to the word "true", ignoring case, and false otherwise.

Common
fun String?.toBoolean(): Boolean

Returns true if this string is not null and its content is equal to the word "true", ignoring case, and false otherwise.

There are also strict versions of the function available on non-nullable String, toBooleanStrict and toBooleanStrictOrNull.

Since Kotlin

1.4
@JvmName(name = "toBooleanNullable")
inline fun String?.toBoolean(): Boolean
fun String?.toBoolean(): Boolean
inline fun String?.toBoolean(): Boolean

Returns true if this string is not null and its content is equal to the word "true", ignoring case, and false otherwise.

There are also strict versions of the function available on non-nullable String, toBooleanStrict and toBooleanStrictOrNull.

Since Kotlin

1.4