We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5944a9c commit f30a6fcCopy full SHA for f30a6fc
1 file changed
style.go
@@ -1,6 +1,8 @@
1
package universalpath
2
3
import (
4
+ "strings"
5
+
6
"github.com/NextronSystems/universalpath/unix"
7
"github.com/NextronSystems/universalpath/windows"
8
)
@@ -83,3 +85,10 @@ func (p Style) IsAbs(s string) bool {
83
85
return windows.IsAbs(s)
84
86
}
87
88
89
+func (p Style) To(other Style, s string) string {
90
+ if p == other {
91
+ return s
92
+ }
93
+ return strings.ReplaceAll(s, p.Separator(), other.Separator())
94
+}
0 commit comments