kiwix-android icon indicating copy to clipboard operation
kiwix-android copied to clipboard

Improve and beautify getDecodedFileName method

Open MohitMaliFtechiz opened this issue 2 years ago • 0 comments

Describe the bug Currently method is written as

getDecodedFileName(url: String?, src: String?): String =
    url?.substringAfterLast("/", "")
      ?.takeIf { it.contains(".") }
      ?: src?.substringAfterLast("/", "")
        ?.substringAfterLast("%3A") ?: ""

Expected behavior We can beautify and improve this piece of method code.

MohitMaliFtechiz avatar Jun 22 '22 10:06 MohitMaliFtechiz