You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Roughly speaking joinpath(args...)=join(args, '/')
plus some magic to let it properly handle cases like joinpath("a/", "b")=="a/b"
(I know it actually isn't implemented much like that)
Analogously we should have its inverse
Roughly: splitpath(arg)=split(arg, '/', keep=false)
so splitpath("a/b/c.txt")==["a", "b", "c.txt"].
I have added to my project:
julia>functionsplitpath(path::AbstractString)
ret=String[]
while(true)
path, lastpart =splitdir(path)
length(lastpart)>0&&unshift!(ret, lastpart)
length(path)==0&&breakendreturn ret
end
splitpath (generic function with 1 method)
julia>splitpath("a/b/c")
3-element Array{String,1}:"a""b""c"
julia>splitpath("a/b/c/")
3-element Array{String,1}:"a""b""c"
julia>splitpath("a/b//c/")
3-element Array{String,1}:"a""b""c"
Though I am not sure of the best way to do this
The text was updated successfully, but these errors were encountered:
Roughly speaking
joinpath(args...)=join(args, '/')
plus some magic to let it properly handle cases like
joinpath("a/", "b")=="a/b"
(I know it actually isn't implemented much like that)
Analogously we should have its inverse
Roughly:
splitpath(arg)=split(arg, '/', keep=false)
so
splitpath("a/b/c.txt")==["a", "b", "c.txt"]
.I have added to my project:
Though I am not sure of the best way to do this
The text was updated successfully, but these errors were encountered: