Open In App

ASP GetExtensionName Method

The GetExtensionName Method in ASP is used for returning a string value that represents the extension name of the file for the last component in the specified path. It is a predefined method of the FileSystem Object. 

Syntax:

FileSystemObject.GetExtensionName(path)

Parameter Value:



Example 1: Below example code demonstrates the GetExtensionName Method.




<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write(fs.GetExtensionName("d:\sudo\GFG.asp"))
set fs=nothing
%>

Output:



asp

Example 2: 




<%
dim fs
set fs=Server.CreateObject("Scripting.FileSystemObject")
Response.Write(fs.GetExtensionName("d:\sudo\GFG.htm"))
set fs=nothing
%>

Output:

htm
Article Tags :