From b3375443998e60cdb25b85b7f04200f557a654a8 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 4 Oct 2019 12:11:03 +0800 Subject: [PATCH] up --- .../main/java/io/legado/app/utils/StringExtensions.kt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) 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