convert Unix path to DOS path

Change all forward slashes into backslashes

Download todospath.zip

Synopsis:

todospath.cs


todospath.cs

Synopsis
using ut;

public class testtodospath
{
  public string toDosPath(string path)
  {
    return path.Replace(@"/", @"\");
  }

  public void test_identities()
  {
    utx.assert(toDosPath(@""), @"");
    utx.assert(toDosPath(@"x"), @"x");
    utx.assert(toDosPath(@"c:\x"), @"c:\x");
  }

  public void test_1()
  {
    utx.assert(toDosPath(@"x/y"), @"x\y");
    utx.assert(toDosPath(@"/y"), @"\y");
    utx.assert(toDosPath(@"x/"), @"x\");
    utx.assert(toDosPath(@"c:x/"), @"c:x\");
    utx.assert(toDosPath(@"/"), @"\");
  }
}






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