Is there some nice way to safely manipulate file paths in Scala, transcending naive string manipulation?
I mean smart concatenation that adds missing slashes between path parts, Unix v.s. Windows slashes, automatically escaping spaces in paths, etc?
What would be a nice Java fallback for that?
You can do it this way:
import java.io.File
val a = "abc/def"
val b = "ghi/jk"
new File(a,b).getPath
// res0: String = abc/def/ghi/jk
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With