CFLib.org – Common Function Library Project

ripExt(name)

Last updated July 18, 2006

author

Richard

Version: 1 | Requires: CF5 | Library: FileSysLib

Description:
This function (which is just a regular expression) strips off the extension from a filename. Dots within the filename are preserved.

Return Values:
Returns a string.

Example:

<cfset filename="this.is.your.file.jpeg">
<cfoutput>#ripExt(filename)#</cfoutput>

Parameters:

Name Description Required
name Filename. Yes

Full UDF Source:

/**
 * Function returns filename without extension.
 * 
 * @param name      Filename. (Required)
 * @return Returns a string. 
 * @author Richard (acdhirr@trilobiet.nl) 
 * @version 1, July 18, 2006 
 */
function ripExt(name) {
    return reReplace(arguments.name,"\.[^.]*$","");
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson