CSplitpath:GetExt2


The GetExt2 method returns the file extension from a CSplitpath object. The extension is returned without a preceding period, in a format like "fts". To return the path with a preceding dot character, use GetExt instead.

Syntax

sExt = CSplitpath:GetExt2()

where

 

    sExt is a string containing the file extension, but without 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:

S = CSplitpath:new( sPath )

-- create a CSplitpath object for path sPath

sExt = S:GetExt2()

-- returns the file extension without a preceding dot

Related Topics

GetExt

CSplitpath class