From 49c0ee63b6cae2324dc1f8b675b776aff3022e6f Mon Sep 17 00:00:00 2001 From: atbest Date: Thu, 23 May 2019 05:10:14 -0400 Subject: [PATCH] Update String extension --- app/src/main/java/io/legado/app/utils/StringExtensions.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 957d5b091..23f35a357 100644 --- a/app/src/main/java/io/legado/app/utils/StringExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/StringExtensions.kt @@ -1,3 +1,6 @@ package io.legado.app.utils -fun String?.strim() = if (this.isNullOrBlank()) null else this.trim() \ No newline at end of file +fun String?.strim() = if (this.isNullOrBlank()) null else this.trim() + +fun String.isAbsUrl() = this.startsWith("http://", true) + || this.startsWith("https://", true)