Scala: Removing first 2 directories from a String -


i have string looks "./path1/path2/path3/path4/etc/file"

i remove first 2 paths , return string looks this:

"path3/path4/etc/file"

how can using scala?

how simple: s.split("/").drop(3).mkstring("/")

in statement firstly split path /, next remove first 3 tokens (as first 1 . in case) , merge tokens create new path.


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -