segments

A list of path segments derived from the URL, excluding any leading and trailing empty segments.

val fullUrl = Url("http://ktor.io/docs/")
fullUrl.segments == listOf("docs")

val absolute = Url("/docs/")
absolute.segments == listOf("docs")
val relative = Url("docs")
relative.segments == listOf("docs")

If you need to check for trailing slash and relative/absolute paths, please check the rawSegments property.