Home > Software engineering >  I want to get the filename from a string type link
I want to get the filename from a string type link

Time:01-01

With Retrofit, I get the url data in string data type, but I need the file name inside the url, how can I get it?

I have visited many websites but I couldn't find any results about it.

CodePudding user response:

Try this in Kotlin

url.substringAfterLast("/").substringBeforeLast(".")
  • Related