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,"\.[^.]*$","");
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson