isValid

inline fun String?.isValid(): Boolean

Return

Whether this string is valid

Examples:

  • null -> false

  • "null" -> false

  • "" -> false

  • "NULL" -> false

  • " " -> false


@get:JvmName(name = "getIsValid")
val String?.isValid: Boolean

Deprecated

Use the function version as it allows for smart-casting

Replace with

this.isValid()

Return

Whether this string is valid

Examples:

  • null -> false

  • "null" -> false

  • "" -> false

  • "NULL" -> false

  • " " -> false