Home > database >  How can i get the filename from a string type link
How can i 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've visited many websites but I couldn't find any results about it.

CodePudding user response:

Try this in Kotlin

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