CSplitpath:GetExt


The GetExt method returns the file extension from a CSplitpath object. The extension is returned with a preceding dot, as in ".fts". To return the path without a preceding dot, use GetExt2().

Syntax

sExt = CSplitpath:GetExt()

where

 

    sExt is a string containing the file extension with a preceding dot. On failure, nil is returned.

Example

Suppose a file exists with a full path named sPath. The following script retrieves the file extension component:

S = CSplitpath:new( sPath )

-- create a CSplitpath object for path sPath

sExt = S:GetExt()

-- returns the file extension

Related Topics

GetExt2

CSplitpath class