LibreTube/app/src/main/java/com/github/libretube/extensions/ToID.kt
2022-11-06 12:53:41 +01:00

12 lines
271 B
Kotlin

package com.github.libretube.extensions
/**
* format a Piped route to an ID
*/
fun String.toID(): String {
return this
.replace("/watch?v=", "") // videos
.replace("/channel/", "") // channels
.replace("/playlist?list=", "") // playlists
}