toPath

expect fun String.toPath(normalize: Boolean = false): Path

Returns the Path representation for this string.

Set normalize to true to eagerly consume .. segments in your path. In all cases, leading .. on absolute paths will be removed.

"/Users/jesse/Documents/../notes.txt".toPath(normalize = false).toString() => "/Users/jesse/Documents/../notes.txt"
"/Users/jesse/Documents/../notes.txt".toPath(normalize = true).toString() => "/Users/jesse/notes.txt"
actual fun String.toPath(normalize: Boolean): Path
actual fun String.toPath(normalize: Boolean): Path