CSplitpath:GetName CSplitpath:SetDir

CSplitpath:Merge


The Merge method combines the path components in a CSplitpath object into a single path. The resulting path string is returned.

Syntax

sString = CSplitpath:Merge()

 

Example

Suppose a file exists with a full path named sPath. The script below changed the file name and extension to the string sNewName and merges the components back into a full path:

 

S = CSplitpath:new( sPath )

-- create a CSplitpath object for the string sPath

S:SetFilenameExt( sNewName )

-- change the file name and extension

sNewPath = S:Merge(sPath)

-- merge components into a new path, sNewPath

 

-- use the path name ...

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath, Split