I write a simple application on kotlin and I encountered the next problem:
I have relative (../../
) and absolute (a/b/c
) paths. I want to get path a/
. How to accomplish that without dancing with strings? Maybe there are methods in java/kotlin which allow to do it?