String toForwardSlashes(String s) { return s.replace("\\", "/"); } String toBackwardSlashes(String s) { return s.replace("/", "\\"); }
Programming Tips - Java: convert a path to Linux-style forward slashes
Date: 2014jan12
Language: Java
Q. Java: convert a path to Linux-style forward slashes
or Windows-style backward slashes
A.