Synopsis: |
| tounixpath.java |
| ||
package jsnippets;
import utjava.ut;
public class tounixpath
{
public String toUnixPath(String path)
{
return path.replace('\\', '/');
}
public void test_identities()
{
ut.utassert(toUnixPath(""), "");
ut.utassert(toUnixPath("x"), "x");
ut.utassert(toUnixPath("c:/x"), "c:/x");
}
public void test_1()
{
ut.utassert(toUnixPath("x\\y"), "x/y");
ut.utassert(toUnixPath("\\y"), "/y");
ut.utassert(toUnixPath("x\\"), "x/");
ut.utassert(toUnixPath("c:x\\"), "c:x/");
ut.utassert(toUnixPath("\\"), "/");
}
}
|
| Contact me about content on this page using john_web-at-arrizza-dot-com |
| For Web Master or site problems contact: webadmin-at-arrizza-dot-com |
| Copyright John Arrizza (c) 2001-2010 |