|
|
@ -20,18 +20,12 @@ fun String?.isJson(): Boolean = this?.run { |
|
|
|
|
|
|
|
|
|
|
|
fun String?.isJsonObject(): Boolean = this?.run { |
|
|
|
fun String?.isJsonObject(): Boolean = this?.run { |
|
|
|
val str = this.trim() |
|
|
|
val str = this.trim() |
|
|
|
when { |
|
|
|
str.startsWith("{") && str.endsWith("}") |
|
|
|
str.startsWith("{") && str.endsWith("}") -> true |
|
|
|
|
|
|
|
else -> false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} ?: false |
|
|
|
} ?: false |
|
|
|
|
|
|
|
|
|
|
|
fun String?.isJsonArray(): Boolean = this?.run { |
|
|
|
fun String?.isJsonArray(): Boolean = this?.run { |
|
|
|
val str = this.trim() |
|
|
|
val str = this.trim() |
|
|
|
when { |
|
|
|
str.startsWith("[") && str.endsWith("]") |
|
|
|
str.startsWith("[") && str.endsWith("]") -> true |
|
|
|
|
|
|
|
else -> false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} ?: false |
|
|
|
} ?: false |
|
|
|
|
|
|
|
|
|
|
|
fun String?.htmlFormat(): String = if (this.isNullOrBlank()) "" else |
|
|
|
fun String?.htmlFormat(): String = if (this.isNullOrBlank()) "" else |
|
|
|