The OpenD Programming Language

stripDrive

Strips the drive from a Windows path. On POSIX, the path is returned unaltered.

  1. auto stripDrive(R path)
  2. auto stripDrive(C[] path)
    stripDrive
    (
    C
    )
    (
    C[] path
    )

Parameters

path C[]

A pathname

Return Value

Type: auto

A slice of path without the drive component.

Examples

version (Windows)
{
    assert(stripDrive(`d:\dir\file`) == `\dir\file`);
    assert(stripDrive(`\\server\share\dir\file`) == `\dir\file`);
}

Meta