diff --git a/app/src/main/java/io/legado/app/utils/StringExtensions.kt b/app/src/main/java/io/legado/app/utils/StringExtensions.kt index a58e17c56..f783373b3 100644 --- a/app/src/main/java/io/legado/app/utils/StringExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/StringExtensions.kt @@ -20,18 +20,12 @@ fun String?.isJson(): Boolean = this?.run { fun String?.isJsonObject(): Boolean = this?.run { val str = this.trim() - when { - str.startsWith("{") && str.endsWith("}") -> true - else -> false - } + str.startsWith("{") && str.endsWith("}") } ?: false fun String?.isJsonArray(): Boolean = this?.run { val str = this.trim() - when { - str.startsWith("[") && str.endsWith("]") -> true - else -> false - } + str.startsWith("[") && str.endsWith("]") } ?: false fun String?.htmlFormat(): String = if (this.isNullOrBlank()) "" else