toPath

fun List<String>.toPath(addPrefix: Boolean = true, addTrailing: Boolean = true, separator: CharSequence = "/"): String

Joins this list of strings into a path with configurable leading and trailing separators.

Extension function on List<String>.

Return

the joined path string

Parameters

addPrefix

whether to prepend separator to the first element if it lacks one (default true)

addTrailing

whether to append separator to the last element (default true)

separator

the path separator (default "/")