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

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

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