winpath

function winpath( path ) --> wpath

Description

Converts a path to the windows style version.

Parameters

path

A unix or windows style path.

Return Values

wpath

A windows style version of the path.

Code

--ZFUNC-winpath-v1
local function winpath( path ) --> wpath
   return path:gsub( "/", "\\" )
end

return winpath

Examples

local t = require( "tapered" )
local winpath = require( "winpath" )

t.is( [[C:\a\b\c]], winpath( "C:/a/b/c" ) )

t.done()

See also