toBoolean

expect fun String?.toBoolean(): Boolean(source)

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

Deprecated

Hidden since 1.4

Use Kotlin compiler 1.4 to avoid deprecation warning.

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

Since Kotlin

1.0
actual fun String?.toBoolean(): Boolean(source)

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

actual inline fun String.toBoolean(): Boolean(source)

Deprecated

Hidden since 1.4

Use Kotlin compiler 1.4 to avoid deprecation warning.

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

Since Kotlin

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

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

actual inline fun String.toBoolean(): Boolean(source)

Deprecated

Hidden since 1.4

Use Kotlin compiler 1.4 to avoid deprecation warning.

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

Since Kotlin

1.0
actual inline fun String?.toBoolean(): Boolean(source)

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

actual inline fun String.toBoolean(): Boolean(source)

Deprecated

Hidden since 1.4

Use Kotlin compiler 1.4 to avoid deprecation warning.

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

Since Kotlin

1.3