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()

 

bullet.gif    On success, this method returns a string containing the file extension without a preceding period.

bullet.gif    On failure, this method returns nil.

Example

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

S = new_splitpath()

-- create a CSplitpath object

S:SetPath(sPath)

-- Specify the path to be split

sExt = S:GetExt2()

-- assigns the file extension component to the string sExt.

S:delete()

-- when done with S, remove it from memory

Related Topics

CSplitpath class

GetExt


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.